1 19 package org.netbeans.modules.versioning.system.cvss; 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 34 39 public class CVS extends VersioningSystem implements VersioningListener, PreferenceChangeListener { 40 41 public CVS() { 42 CvsVersioningSystem.getInstance().addVersioningListener(this); 43 CvsVersioningSystem.getInstance().getStatusCache().addVersioningListener(this); 44 CvsModuleConfig.getDefault().getPreferences().addPreferenceChangeListener(this); 45 } 46 47 public String getDisplayName() { 48 return NbBundle.getMessage(CVS.class, "CTL_CVS_MainMenu"); 49 } 50 51 57 public File getTopmostManagedParent(File file) { 58 return CvsVersioningSystem.getInstance().getTopmostManagedParent(file); 59 } 60 61 public VCSAnnotator getVCSAnnotator() { 62 return CvsVersioningSystem.getInstance().getVCSAnnotator(); 63 } 64 65 public VCSInterceptor getVCSInterceptor() { 66 return CvsVersioningSystem.getInstance().getVCSInterceptor(); 67 } 68 69 public OriginalContent getVCSOriginalContent(File workingCopy) { 70 return CvsVersioningSystem.getInstance().getVCSOriginalContent(workingCopy); 71 } 72 73 public void versioningEvent(VersioningEvent event) { 74 if (event.getId() == FileStatusCache.EVENT_FILE_STATUS_CHANGED) { 75 File file = (File ) event.getParams()[0]; 76 fireStatusChanged(file); 77 } else if (event.getId() == CvsVersioningSystem.EVENT_REFRESH_ANNOTATIONS) { 78 fireStatusChanged((Set<File >) null); 79 } else if (event.getId() == CvsVersioningSystem.EVENT_VERSIONED_FILES_CHANGED) { 80 fireVersionedFilesChanged(); 81 } 82 } 83 84 public void preferenceChange(PreferenceChangeEvent evt) { 85 if (evt.getKey().startsWith(CvsModuleConfig.PROP_COMMIT_EXCLUSIONS)) { 86 fireStatusChanged((Set<File >) null); 87 } else if (evt.getKey().startsWith(CvsModuleConfig.PROP_ANNOTATIONS_VISIBLE)) { 88 fireAnnotationsChanged(null); 89 } else if (evt.getKey().startsWith(CvsModuleConfig.PROP_ANNOTATIONS_FORMAT)) { 90 fireAnnotationsChanged(null); 91 } 92 } 93 } 94 | Popular Tags |