public void elementRemoved ( QueryControllerEntity element ) { if ( element instanceof QueryControllerGroup ) { QueryControllerGroup group = ( QueryControllerGroup ) element ; QueryGroupTreeElement ele = new QueryGroupTreeElement ( group . getID ( ) ) ; Enumeration < TreeNode > groups = root . children ( ) ; while ( groups . hasMoreElements ( ) ) { Object temporal = groups . nextElement ( ) ; if ( ! ( temporal instanceof QueryGroupTreeElement ) ) { continue ; } QueryGroupTreeElement groupTElement = ( QueryGroupTreeElement ) temporal ; if ( groupTElement . getID ( ) . equals ( ele . getID ( ) ) ) { removeNodeFromParent ( groupTElement ) ; nodeStructureChanged ( root ) ; break ; } } } else if ( element instanceof QueryControllerQuery ) { QueryControllerQuery query = ( QueryControllerQuery ) element ; QueryTreeElement elementQuery = new QueryTreeElement ( query . getID ( ) , query . getQuery ( ) ) ; Enumeration < TreeNode > elements = root . children ( ) ; while ( elements . hasMoreElements ( ) ) { TreeNode currentElement = elements . nextElement ( ) ; if ( currentElement instanceof QueryGroupTreeElement ) { continue ; } if ( currentElement instanceof QueryTreeElement ) { QueryTreeElement deleteQuery = ( QueryTreeElement ) currentElement ; if ( deleteQuery . getID ( ) . equals ( elementQuery . getID ( ) ) ) { removeNodeFromParent ( deleteQuery ) ; nodeStructureChanged ( root ) ; break ; } } } } }
Removes a TreeNode group or query from the Tree