Browse Source

Pull request #2247: REPORT-38821 修改获得扩展路径的逻辑

Merge in DESIGN/design from ~YUAN.WANG/design:release/10.0 to release/10.0

* commit '61624fb8558a26cb2c0a82c53f9516b0774dad06':
  REPORT-38821 修改获得扩展路径的逻辑
feature/big-screen
Yuan.Wang 4 years ago
parent
commit
21d27ccf81
  1. 28
      designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java

28
designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java

@ -4,6 +4,9 @@ import com.fr.design.constants.UIConstants;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWAbsoluteBodyLayout;
import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.designer.creator.cardlayout.XCardSwitchButton;
import com.fr.design.designer.treeview.ComponentTreeCellRenderer;
import com.fr.design.designer.treeview.ComponentTreeModel;
import com.fr.design.gui.itree.UITreeUI;
@ -244,12 +247,25 @@ public class ComponentTree extends JTree {
}
public void getExpandNodes(XLayoutContainer container, List<TreePath> searchList) {
for (int i = 0, size = container.getXCreatorCount(); i < size; i++) {
XCreator creator = container.getXCreator(i);
TreePath treePath=buildTreePath(creator);
if(isExpanded(treePath)) searchList.add(treePath);
if (creator instanceof XLayoutContainer) {
getExpandNodes((XLayoutContainer) creator, searchList);
TreePath treePath = buildTreePath(container);
if (isExpanded(treePath)) {
searchList.add(treePath);
for (int i = 0, size = container.getXCreatorCount(); i < size; i++) {
XCreator creator = container.getXCreator(i);
if (creator.acceptType(XLayoutContainer.class) || creator.acceptType(XCardSwitchButton.class)) {
getExpandNodes((XLayoutContainer) creator.getXCreator(), searchList);
}
}
}
//对绝对布局做特殊处理
if (container.acceptType(XWFitLayout.class)) {
XWFitLayout bodyFitLayout = (XWFitLayout) container;
for (int j = 0; j < bodyFitLayout.getXCreatorCount(); j++) {
//类型是绝对布局并且还是body
if (bodyFitLayout.getXCreator(j).acceptType(XWAbsoluteBodyLayout.class)) {
container = (XLayoutContainer) bodyFitLayout.getXCreator(j);
getExpandNodes(container, searchList);
}
}
}
}

Loading…
Cancel
Save