1 19 package org.openide.filesystems; 20 21 import java.util.EventObject ; 22 23 24 28 public final class FileStatusEvent extends EventObject { 29 static final long serialVersionUID = -6428208118782405291L; 30 31 32 private java.util.Set files; 33 34 35 private boolean icon; 36 37 38 private boolean name; 39 40 46 public FileStatusEvent(FileSystem fs, java.util.Set files, boolean icon, boolean name) { 47 super(fs); 48 this.files = files; 49 this.icon = icon; 50 this.name = name; 51 } 52 53 59 public FileStatusEvent(FileSystem fs, FileObject file, boolean icon, boolean name) { 60 this(fs, java.util.Collections.singleton(file), icon, name); 61 } 62 63 72 public FileStatusEvent(FileSystem fs, boolean icon, boolean name) { 73 this(fs, (java.util.Set ) null, icon, name); 74 } 75 76 79 public FileSystem getFileSystem() { 80 return (FileSystem) getSource(); 81 } 82 83 85 public boolean isNameChange() { 86 return name; 87 } 88 89 91 public boolean isIconChange() { 92 return icon; 93 } 94 95 99 public boolean hasChanged(FileObject file) { 100 if (files == null) { 101 try { 103 return file.getFileSystem() == getSource(); 104 } catch (FileStateInvalidException ex) { 105 return false; 107 } 108 } else { 109 return files.contains(file); 111 } 112 } 113 } 114 | Popular Tags |