1 19 20 package org.netbeans.modules.versioning.system.cvss.ui.history; 21 22 import org.openide.nodes.Children; 23 import org.openide.nodes.Node; 24 25 import java.util.*; 26 27 32 class RevisionNodeChildren extends Children.Keys { 33 34 private SearchHistoryPanel.ResultsContainer container; 35 private SearchHistoryPanel.DispRevision revision; 36 37 public RevisionNodeChildren(SearchHistoryPanel.ResultsContainer container) { 38 this.container = container; 39 } 40 41 public RevisionNodeChildren(SearchHistoryPanel.DispRevision revision) { 42 this.revision = revision; 43 } 44 45 protected void addNotify() { 46 refreshKeys(); 47 } 48 49 protected void removeNotify() { 50 setKeys (Collections.EMPTY_SET); 51 } 52 53 private void refreshKeys() { 54 if (container != null) { 55 setKeys(container.getRevisions()); 56 } else { 57 setKeys(revision.getChildren()); 58 } 59 } 60 61 protected Node[] createNodes(Object key) { 62 SearchHistoryPanel.DispRevision fn = (SearchHistoryPanel.DispRevision) key; 63 RevisionNode node = new RevisionNode(fn); 64 return new Node[] { node }; 65 } 66 67 public void refreshChildren() { 68 refreshKeys(); 69 } 70 } 71 | Popular Tags |