1 19 20 package org.netbeans.modules.masterfs.providers; 21 22 import java.io.IOException ; 23 import org.netbeans.modules.masterfs.MasterFileSystem; 24 25 31 public abstract class AnnotationProvider extends Object { 32 33 private org.openide.filesystems.FileStatusListener listener; 34 35 private static Object LOCK = new Object (); 36 37 38 43 public abstract String annotateName (String name, java.util.Set files); 44 45 53 public abstract java.awt.Image annotateIcon (java.awt.Image icon, int iconType, java.util.Set files); 54 55 71 public abstract String annotateNameHtml (String name, java.util.Set files); 72 73 76 public abstract javax.swing.Action [] actions (java.util.Set files); 77 78 82 83 89 public final void addFileStatusListener ( 90 org.openide.filesystems.FileStatusListener listener 91 ) throws java.util.TooManyListenersException { 92 synchronized (LOCK) { 93 if (this.listener != null) { 94 throw new java.util.TooManyListenersException (); 95 } 96 this.listener = listener; 97 } 98 } 99 100 103 public final void removeFileStatusListener ( 104 org.openide.filesystems.FileStatusListener listener 105 ) { 106 synchronized (LOCK) { 107 if (this.listener == listener) { 108 this.listener = null; 109 } 110 } 111 } 112 113 117 protected final void fireFileStatusChanged(org.openide.filesystems.FileStatusEvent event) { 118 org.openide.filesystems.FileStatusListener l; 119 synchronized (LOCK) { 120 l = this.listener; 121 } 122 if (l != null) { 123 126 if (event.getSource() instanceof MasterFileSystem) { 127 l.annotationChanged (event); 128 } 129 } 130 } 131 132 public abstract InterceptionListener getInterceptionListener(); 133 } 134 | Popular Tags |