org.netbeans.modules.versioning/1 1.32.0 1

org.netbeans.modules.versioning.spi
Class VersioningSystem

java.lang.Object
  extended by org.netbeans.modules.versioning.spi.VersioningSystem

public abstract class VersioningSystem
extends Object

Base class for a versioning system that integrates into IDE. A versioning system provides these services: - annotations (coloring, actions) - file system handler - diff provider Versioning system registration can be done in one of the following ways:


Nested Class Summary
static interface VersioningSystem.Registration
           Register a VersioningSystem in the IDE.
 
Field Summary
static String PROP_DISPLAY_NAME
          Short name of the versioning system, it will be used as popup menu label, label in tooltips, etc.
static String PROP_LOCALHISTORY_VCS
          Marker property for a Versioning system that operates in Local History mode.
static String PROP_MENU_LABEL
          Short name of the versioning system, it will be used as menu label and it should define a mnemonic key.
 
Constructor Summary
protected VersioningSystem()
          Protected constructor, does nothing.
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Adds a listener for change events.
protected  void fireAnnotationsChanged(Set<File> files)
          Helper method to signal that annotations of a set of files changed.
protected  void fireStatusChanged(File file)
          Helper method that calls fireStatusChanged(Collections.singleton(file)).
protected  void fireStatusChanged(Set<File> files)
          Helper method to signal that status of a set of files changed.
protected  void fireVersionedFilesChanged()
          Helper method to signal that the versioning system started to manage some previously unversioned files (those files were imported into repository).
 CollocationQueryImplementation getCollocationQueryImplementation()
          Retrieves a CollocationQueryImplementation if this versioning system provides one.
 void getOriginalFile(File workingCopy, File originalFile)
          Get the original (unmodified) copy of a file.
 Object getProperty(String key)
          Gets a general property of a Versioning system.
 File getTopmostManagedAncestor(File file)
          Tests whether the file is managed by this versioning system.
 VCSAnnotator getVCSAnnotator()
          Retrieves a VCSAnnotator implementation if this versioning system provides one.
 VCSHistoryProvider getVCSHistoryProvider()
          Retrieves a VCSHistoryProvider implementation if this versioning system provides one.
 VCSInterceptor getVCSInterceptor()
          Retrieves a VCSInterceptor implementation if this versioning system provides one.
 VCSVisibilityQuery getVisibilityQuery()
          Retrieves a VCSVisibilityQuery implementation if this versioning system provides one.
protected  void putProperty(String key, Object value)
          Sets a general property of a Versioning system.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Removes a listener for change events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_DISPLAY_NAME

public static final String PROP_DISPLAY_NAME
Short name of the versioning system, it will be used as popup menu label, label in tooltips, etc. Examples: CVS, Subversion, Mercurial, Teamware, SourceSafe, VSS, Clearcase, Local History.

See Also:
getProperty(String), putProperty(String, Object), Constant Field Values

PROP_MENU_LABEL

public static final String PROP_MENU_LABEL
Short name of the versioning system, it will be used as menu label and it should define a mnemonic key. Examples: &CVS, &Subversion, &Mercurial, &Teamware, &SourceSafe, &VSS, &Clearcase, Local &History.

See Also:
getProperty(String), putProperty(String, Object), Constant Field Values

PROP_LOCALHISTORY_VCS

public static final String PROP_LOCALHISTORY_VCS
Marker property for a Versioning system that operates in Local History mode. Local History is a special versioning system with these properties: - there is only one local history module active at any one time, the first encoutered module wins - local history module is not exclusive with other registered 'normal' versioning systems. This means that filesystems events may be processed both by Local history module and by some other versioning system module NOTE: Local History is implemented by default, use this only if you are writing a replacement module

See Also:
Constant Field Values
Constructor Detail

VersioningSystem

protected VersioningSystem()
Protected constructor, does nothing.

Method Detail

getProperty

public final Object getProperty(String key)
Gets a general property of a Versioning system.

Parameters:
key - property key
Returns:
Object property value, may be null
See Also:
PROP_DISPLAY_NAME, PROP_MENU_LABEL

putProperty

protected final void putProperty(String key,
                                 Object value)
Sets a general property of a Versioning system.

Parameters:
key - property key, must NOT be null
value - property value, may be null
See Also:
PROP_DISPLAY_NAME, PROP_MENU_LABEL

getTopmostManagedAncestor

public File getTopmostManagedAncestor(File file)
Tests whether the file is managed by this versioning system. If it is, the method should return the topmost ancestor of the file that is still versioned. For example (for CVS) if all your CVS checkouts are in a directory /home/johndoe/projects/cvscheckouts/... then for all files that are under "cvscheckouts" directory and for the directory itselft this method should return "/home/johndoe/projects/cvscheckouts/" and for all other files return null.

Parameters:
file - a file
Returns:
File the file itself or one of its ancestors or null if the supplied file is NOT managed by this versioning system

getVCSAnnotator

public VCSAnnotator getVCSAnnotator()
Retrieves a VCSAnnotator implementation if this versioning system provides one.

Returns:
a VCSAnnotator implementation or null

getVCSInterceptor

public VCSInterceptor getVCSInterceptor()
Retrieves a VCSInterceptor implementation if this versioning system provides one.

Returns:
a VCSInterceptor implementation or null

getVCSHistoryProvider

public VCSHistoryProvider getVCSHistoryProvider()
Retrieves a VCSHistoryProvider implementation if this versioning system provides one.

Returns:
a VCSHistoryProvider implementation or null
Since:
1.29

getOriginalFile

public void getOriginalFile(File workingCopy,
                            File originalFile)
Get the original (unmodified) copy of a file. If the versioning system cannot provide it then this method should do nothing. For version control systems that support keyword expansion, the original file must expand all keywords so the diff sidebar support will not report any differences in keywords.

Parameters:
workingCopy - a File in the working copy
originalFile - placeholder File for the original (unmodified) copy of the working file

getCollocationQueryImplementation

public CollocationQueryImplementation getCollocationQueryImplementation()
Retrieves a CollocationQueryImplementation if this versioning system provides one.

Returns:
CollocationQueryImplementation a CollocationQueryImplementation instance or null if the system does not provide the service
Since:
1.8

getVisibilityQuery

public VCSVisibilityQuery getVisibilityQuery()
Retrieves a VCSVisibilityQuery implementation if this versioning system provides one.

Returns:
VCSVisibilityQuery a VCSVisibilityQuery instance or null if the system does not provide the service
Since:
1.10

addPropertyChangeListener

public final void addPropertyChangeListener(PropertyChangeListener listener)
Adds a listener for change events.

Parameters:
listener - a PropertyChangeListener

removePropertyChangeListener

public final void removePropertyChangeListener(PropertyChangeListener listener)
Removes a listener for change events.

Parameters:
listener - a PropertyChangeListener

fireAnnotationsChanged

protected final void fireAnnotationsChanged(Set<File> files)
Helper method to signal that annotations of a set of files changed. Do NOT fire this event when changes in annotations are caused by changes of status. Status change event will refresh annotations automatically.

Parameters:
files - set of files whose annotations changed or null if the change affects all files

fireStatusChanged

protected final void fireStatusChanged(Set<File> files)
Helper method to signal that status of a set of files changed. Status change event will refresh annotations automatically.

Parameters:
files - set of files whose status changed or null if all files changed status

fireVersionedFilesChanged

protected final void fireVersionedFilesChanged()
Helper method to signal that the versioning system started to manage some previously unversioned files (those files were imported into repository).


fireStatusChanged

protected final void fireStatusChanged(File file)
Helper method that calls fireStatusChanged(Collections.singleton(file)).

Parameters:
file - a file whose status changed
See Also:
fireStatusChanged(java.util.Set)

org.netbeans.modules.versioning/1 1.32.0 1

Built on May 25 2012.  |  Portions Copyright 1997-2012 Oracle. All rights reserved.