Browse Source

REPORT-68455 && REPORT-69108

【问题原因】
1.工具栏面板与其他面板(设计器菜单栏-模板或远程设计-切换工作目录)重叠时会显示异常是因为之前的这个工具栏面板手误写成了继承Panel
2.搜索结果显示不正确是因为之前改卡死问题没改好,把搜索计数放到了处理UI的外面,会优先于数据集树的刷新而变化,导致搜索计数完成了,但是结果没更新的问题
【改动思路】1.改成继承JPanel;2.搜索计数放到处理UI中,确定处理UI完成才算是一次计数完成;3.添加部分debug日志,方便以后排查问题
【review建议】无
bugfix/11.0
Yvan 3 years ago
parent
commit
beec0ef3a7
  1. 14
      designer-base/src/main/java/com/fr/design/data/datapane/management/search/TableDataTreeSearchManager.java
  2. 8
      designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/common/TableDataSearchCallBack.java
  3. 3
      designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/common/TableDataSearchTask.java
  4. 3
      designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/pre/TableDataPreSearchTask.java
  5. 3
      designer-base/src/main/java/com/fr/design/data/datapane/management/search/pane/TreeSearchToolbarPane.java

14
designer-base/src/main/java/com/fr/design/data/datapane/management/search/TableDataTreeSearchManager.java

@ -10,6 +10,7 @@ import com.fr.design.data.datapane.management.search.searcher.TableDataSearchMod
import com.fr.design.data.datapane.management.search.searcher.TableDataTreeSearcher;
import com.fr.design.data.datapane.management.search.searcher.TreeSearchStatus;
import com.fr.design.data.datapane.management.search.view.TreeSearchRendererHelper;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import javax.swing.SwingUtilities;
@ -102,6 +103,7 @@ public class TableDataTreeSearchManager {
rendererHelper = new TreeSearchRendererHelper();
rendererHelper.save(getCurrentTableDataTree());
treeSearcher = new TableDataTreeSearcher();
FineLoggerFactory.getLogger().debug("switch to table data search for mode: {}", searchMode.name());
treeSearcher.beforeSearch(searchMode, tableDataSource);
}
@ -132,6 +134,7 @@ public class TableDataTreeSearchManager {
setTreeSearchStatus(TreeSearchStatus.SEARCHING);
rendererHelper.replaceTreeRenderer(getCurrentTableDataTree(), searchText);
count = new AtomicInteger(treeSearcher.getAllWrappersSize());
FineLoggerFactory.getLogger().debug("start table data search for search text: {}", searchText);
treeSearcher.startSearch(searchText);
}
@ -150,11 +153,9 @@ public class TableDataTreeSearchManager {
}
private boolean isRepeatSearch(String searchText) {
if (StringUtils.isEmpty(lastSearchText)) {
lastSearchText = searchText;
return false;
}
return StringUtils.equals(lastSearchText, searchText);
boolean repeat = StringUtils.equals(lastSearchText, searchText);
lastSearchText = searchText;
return repeat;
}
/**
@ -170,6 +171,7 @@ public class TableDataTreeSearchManager {
public void stopSearch() {
setTreeSearchStatus(TreeSearchStatus.SEARCH_STOPPED);
count = null;
FineLoggerFactory.getLogger().debug("stop table data search for search text: {}", lastSearchText);
treeSearcher.stopSearch();
}
@ -179,6 +181,7 @@ public class TableDataTreeSearchManager {
public void completeSearch() {
setTreeSearchStatus(TreeSearchStatus.SEARCH_COMPLETED);
count = null;
FineLoggerFactory.getLogger().debug("complete table data search for search text: {}", lastSearchText);
treeSearcher.completeSearch();
}
@ -187,6 +190,7 @@ public class TableDataTreeSearchManager {
*/
public void restoreToolBarAndTreePane() {
setTreeSearchStatus(TreeSearchStatus.NOT_IN_SEARCH_MODE);
FineLoggerFactory.getLogger().info("out of table data search");
if (treeSearcher != null) {
treeSearcher.afterSearch();
}

8
designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/common/TableDataSearchCallBack.java

@ -24,14 +24,12 @@ public class TableDataSearchCallBack implements TreeSearchCallback {
if (TableDataTreeSearchManager.getInstance().getTreeSearchStatus() != TreeSearchStatus.SEARCHING) {
return;
}
// 搜索计数
TableDataTreeSearchManager.getInstance().decreaseCount();
if (treeSearchResult.isSuccess()) {
// 添加结果
addToTreeSearcher(treeSearchResult);
// 处理UI
updateTableDataTree();
}
// 处理UI
updateTableDataTree();
}
protected void updateTableDataTree() {
@ -40,6 +38,8 @@ public class TableDataSearchCallBack implements TreeSearchCallback {
return;
}
TableDataTreeSearchManager.getInstance().updateTableDataTree();
// 搜索计数
TableDataTreeSearchManager.getInstance().decreaseCount();
});
}

3
designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/common/TableDataSearchTask.java

@ -43,8 +43,9 @@ public class TableDataSearchTask implements TreeSearchTask {
} else {
result = dealWithCommonTableDataWrapper(tableDataWrapper);
}
FineLoggerFactory.getLogger().debug("calculate {}'s columns succeeded", tableDataWrapper.getTableDataName());
} catch (Throwable e) {
FineLoggerFactory.getLogger().error(e, e.getMessage());
FineLoggerFactory.getLogger().error(e, "calculate {}'s columns failed", tableDataWrapper.getTableDataName());
result = dealWithErrorTableDataWrapper(tableDataWrapper);
}
callback.done(result);

3
designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/pre/TableDataPreSearchTask.java

@ -33,8 +33,9 @@ public class TableDataPreSearchTask implements TreeSearchTask {
result = new TableDataSearchResult.Builder()
.buildSuccess(true)
.build();
FineLoggerFactory.getLogger().debug("pre calculate {}'s columns succeeded", tableDataWrapper.getTableDataName());
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e, "calculate table data {} failed", tableDataWrapper.getTableDataName());
FineLoggerFactory.getLogger().error(e, "pre calculate {}'s columns failed", tableDataWrapper.getTableDataName());
result = new TableDataSearchResult.Builder()
.buildSuccess(false)
.build();

3
designer-base/src/main/java/com/fr/design/data/datapane/management/search/pane/TreeSearchToolbarPane.java

@ -23,7 +23,6 @@ import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Panel;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.KeyAdapter;
@ -34,7 +33,7 @@ import java.awt.event.MouseEvent;
/**
* @author Yvan
*/
public class TreeSearchToolbarPane extends Panel implements TreeSearchStatusChangeListener {
public class TreeSearchToolbarPane extends JPanel implements TreeSearchStatusChangeListener {
public static final String TOOLBAR_PANE = "toolbarPane";

Loading…
Cancel
Save