use of org.apache.airavata.workflow.model.component.ComponentOperationReference in project airavata by apache.
the class ComponentSelector method expandTreeLeaf.
private void expandTreeLeaf(ComponentTreeNode selectedNode, List<? extends Component> components) {
ComponentReference componentReference = selectedNode.getComponentReference();
ComponentTreeNode newNode = new ComponentTreeNode(componentReference.getName());
ComponentTreeNode parent = (ComponentTreeNode) selectedNode.getParent();
int index = this.treeModel.getIndexOfChild(parent, selectedNode);
this.treeModel.removeNodeFromParent(selectedNode);
this.treeModel.insertNodeInto(newNode, parent, index);
for (Component component : components) {
WSComponent wsComponent = (WSComponent) component;
String operationName = wsComponent.getOperationName();
ComponentOperationReference reference = new ComponentOperationReference(operationName, wsComponent);
ComponentTreeNode child = new ComponentTreeNode(reference);
this.treeModel.addNodeInto(child, newNode);
}
// expand
TreeNode[] path = newNode.getPath();
this.tree.expandPath(new TreePath(path));
}
Aggregations