@Override public void nodesWereInserted(N parent, int[] indices) { model.nodesWereInserted(parent, indices); }
@Override public void nodeWereInserted(N parentNode, int childIndice, N node) { int[] indices = new int[1]; indices[0] = childIndice; model.nodesWereInserted(parentNode, indices); }
/** * Node added. * * @param parentNode the parent node * @param index the index */ public static void nodeAdded(DefaultMutableTreeNode parentNode, int index) { if (fileSystemTreeComponent != null) { ((DefaultTreeModel) fileSystemTreeComponent.getModel()) .nodesWereInserted(parentNode, new int[] {index}); } }
/** * Adds a group to consolidate mods. * * TODO: Trigger a rename. */ public void addGroup() { DefaultMutableTreeNode rootNode = (DefaultMutableTreeNode)treeModel.getRoot(); DefaultMutableTreeNode groupNode = new DefaultMutableTreeNode( "New Group", true ); rootNode.add( groupNode ); treeModel.nodesWereInserted( rootNode, new int[]{rootNode.getIndex( groupNode )} ); }
/** * set the loading state */ private void setLoading() { setChildren(createLoadingNode()); TreeModel model = tree.getModel(); if (model instanceof DefaultTreeModel) { DefaultTreeModel defaultModel = (DefaultTreeModel) model; int[] indices = new int[getChildCount()]; for (int i = 0; i < indices.length; i++) { indices[i] = i; } defaultModel.nodesWereInserted(LazyLoadingTreeNode.this, indices); } }
model.nodesWereInserted(root, new int[] { model.getIndexOfChild(root, node) });
root.add(treeNode); if (fireEvent) { ((DefaultTreeModel) _tree.getModel()).nodesWereInserted(root, new int[]{root.getIndex(treeNode)}); parentNode.add(treeNode); if (fireEvent) { ((DefaultTreeModel) _tree.getModel()).nodesWereInserted(parentNode, new int[]{parentNode.getIndex(treeNode)});
root.add(treeNode); if (fireEvent) { ((DefaultTreeModel) _tree.getModel()).nodesWereInserted(root, new int[]{root.getIndex(treeNode)}); parentNode.add(treeNode); if (fireEvent) { ((DefaultTreeModel) _tree.getModel()).nodesWereInserted(parentNode, new int[]{parentNode.getIndex(treeNode)});
DefaultMutableTreeNode root = (DefaultMutableTreeNode) model.getRoot(); root.add(new DefaultMutableTreeNode("A new node")); model.nodesWereInserted(root, new int[] { root.getChildCount() - 1 }); tree1.expandRow(0); tree2.expandRow(0);
((DefaultTreeModel)ridtree.getModel()).nodesWereInserted(this, addis);
model.nodesWereInserted(node, new int[]{node.getChildCount()-1,node.getChildCount()-2}); break;
((DefaultTreeModel)ridtree.getModel()).nodesWereInserted(this, addis);
System.arraycopy(t, 0, childIndices, 0, addedNum); m_nodeTree.getTreeModel().nodesWereInserted(this, childIndices);
int childIndex = parent.getIndex(tn) + 1; parent.insert(newFolder, childIndex); treeModel.nodesWereInserted(parent, new int[]{childIndex}); treeModel.nodesWereInserted(root, childIndices);
this.tree.nodesWereInserted(parent, new int[] { index - 1 }); } else { if (LOGGER.isLoggable(Level.INFO)) {
int childIndex = parent.getIndex(tn) + 1; parent.insert(newFolder, childIndex); treeModel.nodesWereInserted(parent, new int[]{childIndex}); treeModel.nodesWereInserted(root, childIndices);
m_children.add(insertIndex, tn); final int tnIndex = getIndex(tn); m_nodeTree.getTreeModel().nodesWereInserted(this, new int[]{tnIndex});
dstTreeModel.nodesWereInserted( dropParentNode, new int[]{dropIndex} ); dstTreeModel.nodesWereInserted( dropParentNode, new int[]{addIndex} ); if ( !dstTree.isExpanded( dropPath ) ) dstTree.expandPath( dropPath );
/** * Adds a new group to our tree and element model. */ final void addNewGroup() { DefaultTreeModel model = ( DefaultTreeModel )this.tree.getModel(); boolean groupSummaryVisibleByDefault = UIManager.getBoolean( GROUP_SUMMARY_VISIBLE_DEFAULT ); boolean scopeVisibleByDefault = UIManager.getBoolean( ANALOG_SCOPE_VISIBLE_DEFAULT ); int groupCount = this.model.getGroups().size(); String name = String.format( "Group %d", Integer.valueOf( groupCount + 1 ) ); // Create model structure... ElementGroup newGroup = this.model.addGroup( name ); newGroup.setVisible( true ); SignalElement groupSummaryElement = SignalElement.createGroupSummaryElement( newGroup ); groupSummaryElement.setEnabled( groupSummaryVisibleByDefault ); newGroup.addElement( groupSummaryElement ); SignalElement analogScopeElement = SignalElement.createAnalogScopeElement( newGroup ); analogScopeElement.setEnabled( scopeVisibleByDefault ); newGroup.addElement( analogScopeElement ); // Create tree structure... ElementTreeNode rootNode = ( ElementTreeNode )model.getRoot(); ElementTreeNode groupNode = new ElementTreeNode( newGroup ); rootNode.add( groupNode ); groupNode.add( new ElementTreeNode( groupSummaryElement ) ); groupNode.add( new ElementTreeNode( analogScopeElement ) ); int index = rootNode.getIndex( groupNode ); model.nodesWereInserted( rootNode, new int[] { index } ); model.nodeStructureChanged( groupNode ); this.tree.expandRow( index ); }
private void setFileIssues(VirtualFile file, Iterable<LiveIssue> issues) { if (!accept(file)) { removeFile(file); return; } List<LiveIssue> filtered = filter(issues); if (filtered.isEmpty()) { removeFile(file); return; } boolean newFile = false; FileNode fNode = index.getFileNode(file); if (fNode == null) { newFile = true; fNode = new FileNode(file); index.setFileNode(fNode); } setIssues(fNode, filtered); if (newFile) { AbstractNode parent = getFilesParent(); int idx = parent.getInsertIdx(fNode, new FileNodeComparator()); int[] newIdx = {idx}; model.nodesWereInserted(parent, newIdx); model.nodeChanged(parent); } else { model.nodeStructureChanged(fNode); } }