1 19 package org.netbeans.modules.subversion; 20 21 import org.netbeans.modules.versioning.spi.VersioningSystem; 22 import org.netbeans.modules.versioning.spi.VCSAnnotator; 23 import org.netbeans.modules.versioning.spi.VCSInterceptor; 24 import org.netbeans.modules.versioning.spi.OriginalContent; 25 import org.netbeans.modules.versioning.util.VersioningListener; 26 import org.netbeans.modules.versioning.util.VersioningEvent; 27 import org.openide.util.NbBundle; 28 29 import java.io.File ; 30 import java.util.*; 31 import java.util.prefs.PreferenceChangeEvent ; 32 import java.util.prefs.PreferenceChangeListener ; 33 import java.beans.PropertyChangeListener ; 34 import java.beans.PropertyChangeEvent ; 35 36 39 public class SubversionVCS extends VersioningSystem implements VersioningListener, PreferenceChangeListener , PropertyChangeListener { 40 41 public SubversionVCS() { 42 Subversion.getInstance().getStatusCache().addVersioningListener(this); 43 Subversion.getInstance().addPropertyChangeListener(this); 44 SvnModuleConfig.getDefault().getPreferences().addPreferenceChangeListener(this); 45 } 46 47 public String getDisplayName() { 48 return NbBundle.getMessage(SubversionVCS.class, "CTL_Subversion_MainMenu"); 49 } 50 51 public File getTopmostManagedParent(File file) { 52 return Subversion.getInstance().getTopmostManagedParent(file); 53 } 54 55 public VCSAnnotator getVCSAnnotator() { 56 return Subversion.getInstance().getVCSAnnotator(); 57 } 58 59 public VCSInterceptor getVCSInterceptor() { 60 return Subversion.getInstance().getVCSInterceptor(); 61 } 62 63 public OriginalContent getVCSOriginalContent(File file) { 64 return Subversion.getInstance().getVCSOriginalContent(file); 65 } 66 67 public void versioningEvent(VersioningEvent event) { 68 if (event.getId() == FileStatusCache.EVENT_FILE_STATUS_CHANGED) { 69 File file = (File ) event.getParams()[0]; 70 fireStatusChanged(file); 71 } 72 } 73 74 public void preferenceChange(PreferenceChangeEvent evt) { 75 if (evt.getKey().startsWith(SvnModuleConfig.PROP_COMMIT_EXCLUSIONS)) { 76 fireStatusChanged((Set<File >) null); 77 } else if (evt.getKey().startsWith(SvnModuleConfig.PROP_TEXT_ANNOTATIONS_FORMAT)) { 78 fireAnnotationsChanged((Set<File >) null); 79 } 80 } 81 82 public void propertyChange(PropertyChangeEvent evt) { 83 if (evt.getPropertyName().equals(Subversion.PROP_ANNOTATIONS_CHANGED)) { 84 fireAnnotationsChanged((Set<File >) evt.getNewValue()); 85 } else if (evt.getPropertyName().equals(Subversion.PROP_VERSIONED_FILES_CHANGED)) { 86 fireVersionedFilesChanged(); 87 } 88 } 89 } 90 | Popular Tags |