Browse Source

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

* commit '21d27ccf8174394249cc7131c7e359ad13fc051f':
  REPORT-38821 修改获得扩展路径的逻辑
bugfix/10.0
superman 4 years ago
parent
commit
bd41dc8b29
  1. 24
      designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java

24
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.XCreator;
import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.design.designer.creator.XLayoutContainer; 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.ComponentTreeCellRenderer;
import com.fr.design.designer.treeview.ComponentTreeModel; import com.fr.design.designer.treeview.ComponentTreeModel;
import com.fr.design.gui.itree.UITreeUI; import com.fr.design.gui.itree.UITreeUI;
@ -244,12 +247,25 @@ public class ComponentTree extends JTree {
} }
public void getExpandNodes(XLayoutContainer container, List<TreePath> searchList) { public void getExpandNodes(XLayoutContainer container, List<TreePath> searchList) {
TreePath treePath = buildTreePath(container);
if (isExpanded(treePath)) {
searchList.add(treePath);
for (int i = 0, size = container.getXCreatorCount(); i < size; i++) { for (int i = 0, size = container.getXCreatorCount(); i < size; i++) {
XCreator creator = container.getXCreator(i); XCreator creator = container.getXCreator(i);
TreePath treePath=buildTreePath(creator); if (creator.acceptType(XLayoutContainer.class) || creator.acceptType(XCardSwitchButton.class)) {
if(isExpanded(treePath)) searchList.add(treePath); getExpandNodes((XLayoutContainer) creator.getXCreator(), searchList);
if (creator instanceof XLayoutContainer) { }
getExpandNodes((XLayoutContainer) creator, 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