private DisposerTree(Disposable parent) { myModificationToFilter = -1; final DisposerStructure structure = new DisposerStructure(this); final DefaultTreeModel model = new DefaultTreeModel(new DefaultMutableTreeNode()); final Tree tree = new Tree(model); tree.setRootVisible(false); tree.setShowsRootHandles(true); tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); myTreeBuilder = new FilteringTreeBuilder(tree, DisposerTree.this, structure, AlphaComparator.INSTANCE) { @Override public boolean isAutoExpandNode(NodeDescriptor nodeDescriptor) { return structure.getRootElement() == getOriginalNode(nodeDescriptor); } }; myTreeBuilder.setFilteringMerge(200, MergingUpdateQueue.ANY_COMPONENT); Disposer.register(this, myTreeBuilder); myTree = tree; setLayout(new BorderLayout()); add(ScrollPaneFactory.createScrollPane(myTree), BorderLayout.CENTER); Disposer.getTree().addListener(this); Disposer.register(parent, this); }
private void initBuilder() throws Exception { myBuilder = new FilteringTreeBuilder(myTree, myFilter, myStructure, AlphaComparator.INSTANCE) { @Override protected AbstractTreeUpdater createUpdater() { return _createUpdater(this); } }; showTree(); Disposer.register(getRootDisposable(), myBuilder); }
private void revalidateTree() { FilteringTreeBuilder.revalidateTree(myTree); }
public FilteringTreeBuilder getBuilder() { return getPopup().getTreeBuilder(); }
private ActionCallback processSelected(final Configurable configurable, final Configurable oldConfigurable) { if (isShowing(configurable)) return ActionCallback.DONE; final ActionCallback result = new ActionCallback(); if (configurable == null) { myOwnDetails.setContent(null); myFilter.updateSpotlight(true); checkModified(oldConfigurable); result.setDone(); } else { getUiFor(configurable).doWhenDone(new EdtRunnable() { @Override public void runEdt() { if (myDisposed) return; final Configurable current = getContext().getCurrentConfigurable(); if (current != configurable) { result.setRejected(); return; } myHistory.pushQueryPlace(); updateDetails(); myOwnDetails.setContent(myContentWrapper); myOwnDetails.setBannerMinHeight(mySearchWrapper.getHeight()); myOwnDetails.setText(getBannerText(configurable)); if (myTreeView != null) { myOwnDetails.forProject(myTreeView.findConfigurableProject(configurable)); } else if (Registry.is("ide.new.settings.dialog")) { myOwnDetails.forProject(myTree.getConfigurableProject(configurable)); } final ConfigurableContent content = myConfigurable2Content.get(current); content.setText(getBannerText(configurable)); content.setBannerActions(new Action[] {new ResetAction(configurable)}); content.updateBannerActions(); myLoadingDecorator.stopLoading(); myFilter.updateSpotlight(false); checkModified(oldConfigurable); checkModified(configurable); FilteringTreeBuilder builder = myTreeView != null ? myTreeView.myBuilder : myTree.myBuilder; if (builder.getSelectedElements().size() == 0) { select(configurable).notify(result); } else { result.setDone(); } } }); } return result; }
public FilteringTreeBuilder getTreeBuilder() { return myAbstractTreeBuilder; }
protected FilteringTreeBuilder getBuilder() { return myPopup.getTreeBuilder(); }