This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 49989
Collapse All | Expand All

(-)ResultView.java (+59 lines)
Lines 30-36 Link Here
30
import java.util.Observable;
30
import java.util.Observable;
31
import java.util.Observer;
31
import java.util.Observer;
32
import javax.accessibility.AccessibleContext;
32
import javax.accessibility.AccessibleContext;
33
import javax.swing.AbstractAction;
33
import javax.swing.AbstractButton;
34
import javax.swing.AbstractButton;
35
import javax.swing.Action;
34
import javax.swing.ActionMap;
36
import javax.swing.ActionMap;
35
import javax.swing.BorderFactory;
37
import javax.swing.BorderFactory;
36
import javax.swing.Box;
38
import javax.swing.Box;
Lines 827-832 Link Here
827
    /**
829
    /**
828
     */
830
     */
829
    private class RootNode extends AbstractNode {
831
    private class RootNode extends AbstractNode {
832
833
        /** */
834
        private Action expandAllAction;
830
        
835
        
831
        /**
836
        /**
832
         */
837
         */
Lines 838-843 Link Here
838
         */
843
         */
839
        void changeChildren(final Children children) {
844
        void changeChildren(final Children children) {
840
            super.setChildren(children);
845
            super.setChildren(children);
846
        }
847
848
        /**
849
         */
850
        public Action[] getActions(boolean contextActions) {
851
            if (contextActions) {
852
                return super.getActions(contextActions);
853
            } else if (isEmpty()) {
854
                return new Action[0];
855
            } else {
856
                if (expandAllAction == null) {
857
                    expandAllAction = new ExpandAllAction();
858
                }
859
                return new Action[] { expandAllAction };
860
            }
861
        }
862
863
        /**
864
         */
865
        private boolean isEmpty() {
866
            if (isLeaf()) {
867
                return true;
868
            }
869
870
            try {
871
                ResultTreeChildren children = (ResultTreeChildren) getChildren();
872
                return children.isEmpty();
873
            } catch (ClassCastException ex) {
874
                assert false;
875
                ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL,
876
                                                 ex);
877
            }
878
            return false;
879
        }
880
881
        /**
882
         */
883
        private final class ExpandAllAction extends AbstractAction {
884
885
            /**
886
             */
887
            private ExpandAllAction() {
888
                String name = NbBundle.getMessage(
889
                                      getClass(),
890
                                      "TEXT_LABEL_ExpandAllActionName");//NOI18N
891
                putValue(Action.NAME, name);
892
            }
893
894
            /**
895
             */
896
            public void actionPerformed(ActionEvent e) {
897
                ResultView.this.treeView.expandAll();
898
            }
899
841
        }
900
        }
842
        
901
        
843
    }
902
    }
(-)ResultTreeChildren.java (+1 lines)
Lines 215-220 Link Here
215
            removed = keys.remove(foundObject);
215
            removed = keys.remove(foundObject);
216
        }
216
        }
217
        if (removed) {
217
        if (removed) {
218
            size--;
218
            sort(sorted);
219
            sort(sorted);
219
        }
220
        }
220
    }
221
    }
(-)Bundle.properties (+3 lines)
Lines 67-72 Link Here
67
# RemoveFromSearchAction
67
# RemoveFromSearchAction
68
TEXT_LABEL_RemoveFromSearchActionName=Remove From Search
68
TEXT_LABEL_RemoveFromSearchActionName=Remove From Search
69
69
70
# ExpandAllAction
71
TEXT_LABEL_ExpandAllActionName=Expand All
72
70
#Result view texts
73
#Result view texts
71
TEXT_MSG_NO_NODE_FOUND=No matching nodes were found.
74
TEXT_MSG_NO_NODE_FOUND=No matching nodes were found.
72
TEXT_MSG_FOUND_X_NODES=Found {0} matching nodes.
75
TEXT_MSG_FOUND_X_NODES=Found {0} matching nodes.

Return to bug 49989