Browse Source

Merge pull request #2258 in DESIGN/design from bugfix/10.0 to feature/10.0

* commit 'bd41dc8b2948cf288e573390b4740af135edc2e0':
  REPORT-38821 修改获得扩展路径的逻辑
research/11.0
superman 4 years ago
parent
commit
c6a4b0d75d
  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