Browse Source

Merge pull request #2646 in DESIGN/design from release/10.0 to bugfix/10.0

* commit '7ba45fb5b11a4918ac8f30ab8d6b0914e0e70994':
  REPORT-41543 触发一下pr
  REPORT-41491【冒烟】af搜索结果错乱
  REPORT-41414 && REPORT-41495 【问题原因】REPORT-41414中之前改动没有考虑到菜单栏-模板-模板数据集界面中也会包括MaxMemRowCountPanel,然而模板数据集界面中给MaxMemRowCountPanel的空间比较小,会造成MaxMemRowCountPanel显示异常;REPORT-41495产生原因是Windows下的JDK11绘制时会有缩放效果,这里是字被放大了一点,把后面的框挤下去了,而之前回归改动只修改了"文件重命名"的情况,没有考虑"文件夹重命名" 【改动思路】REPORT-41414 在DBTableDataPane中把中间一部分的宽度缩短一点,相当于拉长了右侧的MaxMemRowCountPanel;REPORT-41495中将文本框缩小一点
  REPORT-41333 【冒烟】全局参数添加两个参数p1p2,将p2重命名为p1,不会有参数名重复的提醒
  REPORT-41333 【冒烟】全局参数添加两个参数p1p2,将p2重命名为p1,不会有参数名重复的提醒
bugfix/10.0
superman 4 years ago
parent
commit
987262feaa
  1. 3
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java
  2. 2
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  3. 7
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/ContentCellRender.java
  4. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java
  5. 11
      designer-realize/src/test/java/com/fr/design/mainframe/alphafine/cell/render/ContentCellRenderTest.java

3
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java

@ -185,7 +185,8 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
box.setMinimumSize(new Dimension(300, 400)); box.setMinimumSize(new Dimension(300, 400));
// 防止数据连接名过长时影响 split pane 分割效果 // 防止数据连接名过长时影响 split pane 分割效果
connectionTableProcedurePane.setMinimumSize(new Dimension(250, 400)); // 本界面中给MaxMemRowCountPanel留的空间太小,造成MaxMemRowCountPanel显示异常,这边减小一点最小宽度,拉长MaxMemRowCountPanel
connectionTableProcedurePane.setMinimumSize(new Dimension(230, 400));
connectionTableProcedurePane.setMaximumSize(new Dimension(500, 400)); connectionTableProcedurePane.setMaximumSize(new Dimension(500, 400));
// 使用SplitPane // 使用SplitPane
JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, connectionTableProcedurePane, sqlSplitPane); JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, connectionTableProcedurePane, sqlSplitPane);

2
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java

@ -578,7 +578,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
} }
}); });
nameField.selectAll(); nameField.selectAll();
nameField.setPreferredSize(new Dimension(180, 20)); nameField.setPreferredSize(new Dimension(170, 20));
JPanel topPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 5)); JPanel topPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 5));
topPanel.setBorder(BorderFactory.createEmptyBorder(15, 15, 0, 15)); topPanel.setBorder(BorderFactory.createEmptyBorder(15, 15, 0, 15));

7
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/ContentCellRender.java

@ -124,7 +124,10 @@ public class ContentCellRender implements ListCellRenderer<Object> {
private String getReplacedString(String modelName, String string) { private String getReplacedString(String modelName, String string) {
//需要考虑modelName有空格的情况 //需要考虑modelName有空格的情况
//比如现在是work boo k 搜索词是workb,应该要替换的部分是work b //比如现在是work boo k 搜索词是workb,应该要替换的部分是work b
//先去掉空格进行匹配 //先去掉已经匹配替换过的部分,因为考虑到分词的情况,可能会进行多次替换
final String regex = "\\|<font.*?</font>\\|";
modelName = modelName.replaceAll(regex, StringUtils.EMPTY);
//再去掉空格进行匹配
String noBlackName = modelName.replaceAll(StringUtils.BLANK, StringUtils.EMPTY).toLowerCase(); String noBlackName = modelName.replaceAll(StringUtils.BLANK, StringUtils.EMPTY).toLowerCase();
int index = noBlackName.indexOf(string.toLowerCase()); int index = noBlackName.indexOf(string.toLowerCase());
if (index == -1) { if (index == -1) {
@ -139,6 +142,4 @@ public class ContentCellRender implements ListCellRenderer<Object> {
} }
return result.toString(); return result.toString();
} }
} }

2
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java

@ -112,7 +112,7 @@ public class FileSearchManager implements AlphaFineSearchProvider {
name = name.replaceAll(StringUtils.BLANK, StringUtils.EMPTY); name = name.replaceAll(StringUtils.BLANK, StringUtils.EMPTY);
if (name.contains(searchText)) { if (name.contains(searchText)) {
FileModel model = new FileModel(node.getName(), node.getEnvPath()); FileModel model = new FileModel(node.getName(), node.getEnvPath());
if (!AlphaFineHelper.getFilterResult().contains(model)) { if (!AlphaFineHelper.getFilterResult().contains(model) && !filterModelList.contains(model)) {
AlphaFineHelper.checkCancel(); AlphaFineHelper.checkCancel();
filterModelList.add(model); filterModelList.add(model);
} }

11
designer-realize/src/test/java/com/fr/design/mainframe/alphafine/cell/render/ContentCellRenderTest.java

@ -1,7 +1,9 @@
package com.fr.design.mainframe.alphafine.cell.render; package com.fr.design.mainframe.alphafine.cell.render;
import com.fr.stable.StringUtils;
import org.junit.Test; import org.junit.Test;
import static org.junit.Assert.*; import static org.junit.Assert.*;
/** /**
@ -13,11 +15,20 @@ public class ContentCellRenderTest {
@Test @Test
public void highLightModelName() { public void highLightModelName() {
final String regex = "<font.*?</font>";
String searchText = "workb"; String searchText = "workb";
ContentCellRender contentCellRender = new ContentCellRender(searchText,new String[]{searchText}); ContentCellRender contentCellRender = new ContentCellRender(searchText,new String[]{searchText});
String workbook = contentCellRender.highLightModelName("workbook", new String[]{searchText}); String workbook = contentCellRender.highLightModelName("workbook", new String[]{searchText});
assertTrue(workbook.endsWith("workb</font>ook</body></HTML>")); assertTrue(workbook.endsWith("workb</font>ook</body></HTML>"));
workbook = contentCellRender.highLightModelName("work book", new String[]{searchText}); workbook = contentCellRender.highLightModelName("work book", new String[]{searchText});
assertTrue(workbook.endsWith("work b</font>ook</body></HTML>")); assertTrue(workbook.endsWith("work b</font>ook</body></HTML>"));
searchText = "我是空格";
contentCellRender = new ContentCellRender(searchText, new String[]{"我是空格", "我是", "空格"});
workbook = contentCellRender.highLightModelName("我是 空格", new String[]{searchText});
assertEquals(workbook.replaceFirst(regex, StringUtils.EMPTY), workbook.replaceAll(regex, StringUtils.EMPTY));
workbook = contentCellRender.highLightModelName("我是是 空格", new String[]{"我是空格", "我是", "空格"});
assertNotEquals(workbook.replaceFirst(regex, StringUtils.EMPTY), workbook.replaceAll(regex, StringUtils.EMPTY));
} }
} }
Loading…
Cancel
Save