private void init() { super.setName(filter.getName()); String tooltip = filter.getDisplayName(); this.setShortDescription(tooltip); this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/file-size-16.png"); // NON-NLS updateDisplayName(); }
/** * @param skCase * @param filter * @param o Observable that provides updates when events are fired */ FileSizeNode(SleuthkitCase skCase, FileSizeFilter filter, Observable o) { super( Children.create(new FileSizeChildren(filter, skCase, o), true), Lookups.singleton(filter.getDisplayName())); this.filter = filter; init(); o.addObserver(new FileSizeNodeObserver()); }
// use version with observer instead so that it updates @Deprecated FileSizeNode(SleuthkitCase skCase, FileSizeFilter filter) { super( Children.create(new FileSizeChildren(filter, skCase, null), true), Lookups.singleton(filter.getDisplayName())); this.filter = filter; init(); }
@Override protected Sheet createSheet() { Sheet s = super.createSheet(); Sheet.Set ss = s.get(Sheet.PROPERTIES); if (ss == null) { ss = Sheet.createPropertiesSet(); s.put(ss); } ss.put( new NodeProperty<>( NbBundle.getMessage(this.getClass(), "FileSize.createSheet.filterType.name"), NbBundle.getMessage(this.getClass(), "FileSize.createSheet.filterType.displayName"), NbBundle.getMessage(this.getClass(), "FileSize.createSheet.filterType.desc"), filter.getDisplayName())); return s; }
private void updateDisplayName() { final long count = FileSizeChildren.calculateItems(skCase, filter); super.setDisplayName(filter.getDisplayName() + " (" + count + ")"); }
@Override protected boolean createKeys(List<FileSizeFilter> list) { list.addAll(Arrays.asList(FileSizeFilter.values())); return true; }