Search in sources :

Example 1 with ComponentOperationReference

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));
}
Also used : ComponentOperationReference(org.apache.airavata.workflow.model.component.ComponentOperationReference) TreePath(javax.swing.tree.TreePath) TreeNode(javax.swing.tree.TreeNode) ComponentReference(org.apache.airavata.workflow.model.component.ComponentReference) WSComponent(org.apache.airavata.workflow.model.component.ws.WSComponent) WSComponent(org.apache.airavata.workflow.model.component.ws.WSComponent) Component(org.apache.airavata.workflow.model.component.Component) XBayaComponent(org.apache.airavata.xbaya.ui.widgets.XBayaComponent) Point(java.awt.Point)

Aggregations

Point (java.awt.Point)1 TreeNode (javax.swing.tree.TreeNode)1 TreePath (javax.swing.tree.TreePath)1 Component (org.apache.airavata.workflow.model.component.Component)1 ComponentOperationReference (org.apache.airavata.workflow.model.component.ComponentOperationReference)1 ComponentReference (org.apache.airavata.workflow.model.component.ComponentReference)1 WSComponent (org.apache.airavata.workflow.model.component.ws.WSComponent)1 XBayaComponent (org.apache.airavata.xbaya.ui.widgets.XBayaComponent)1