public final class ProjectLevelVcsManagerImpl extends ProjectLevelVcsManagerEx implements PersistentStateComponent<Element>, Disposable
Disposable.Parent
VCS_CONFIGURATION_CHANGED, VCS_CONFIGURATION_CHANGED_IN_PLUGIN
Constructor and Description |
---|
ProjectLevelVcsManagerImpl(Project project) |
Modifier and Type | Method and Description |
---|---|
void |
addInitializationRequest(VcsInitObject vcsInitObject,
java.lang.Runnable runnable) |
void |
addMessageToConsoleWindow(java.lang.String message,
ConsoleViewContentType contentType) |
void |
addMessageToConsoleWindow(java.lang.String message,
TextAttributes attributes)
Deprecated.
|
void |
addVcsListener(VcsListener listener)
Adds a listener for receiving notifications about changes in VCS configuration for the project.
|
boolean |
checkAllFilesAreUnder(AbstractVcs abstractVcs,
VirtualFile[] files)
Checks if all given files are managed by the specified VCS.
|
boolean |
checkVcsIsActive(AbstractVcs vcs)
Checks if the specified VCS is used by any of the modules in the project.
|
boolean |
checkVcsIsActive(java.lang.String vcsName)
Checks if the VCS with the specified name is used by any of the modules in the project.
|
void |
dispose()
Usually not invoked directly, see class javadoc.
|
AbstractVcs |
findVcsByName(java.lang.String name)
Returns the version control system with the specified name.
|
AbstractVcs |
findVersioningVcs(VirtualFile file)
Used to guess VCS for automatic mapping through a look into a working copy
|
void |
fireDirectoryMappingsChanged() |
AbstractVcs [] |
getAllActiveVcss()
Returns the list of VCSes used by at least one module in the project.
|
java.util.List<VcsShowConfirmationOptionImpl> |
getAllConfirmations() |
java.util.List<VcsShowOptionsSettingImpl> |
getAllOptions() |
VcsRoot [] |
getAllVcsRoots() |
VcsDescriptor[] |
getAllVcss()
Returns the list of all registered version control systems.
|
VirtualFile[] |
getAllVersionedRoots() |
VcsAnnotationLocalChangesListener |
getAnnotationLocalChangesListener() |
BackgroundableActionEnabledHandler |
getBackgroundableActionHandler(VcsBackgroundableActions action)
Deprecated.
|
CheckoutProvider.Listener |
getCompositeCheckoutListener() |
VcsShowConfirmationOptionImpl |
getConfirmation(VcsConfiguration.StandardConfirmation option) |
ContentManager |
getContentManager() |
ContentRevisionCache |
getContentRevisionCache() |
VcsDescriptor |
getDescriptor(java.lang.String name) |
java.util.List<VirtualFile> |
getDetailedVcsMappings(AbstractVcs vcs)
Also includes into list all modules under roots
|
VcsDirectoryMapping |
getDirectoryMappingFor(FilePath file) |
java.util.List<VcsDirectoryMapping> |
getDirectoryMappings() |
java.util.List<VcsDirectoryMapping> |
getDirectoryMappings(AbstractVcs vcs) |
static ProjectLevelVcsManagerImpl |
getInstanceImpl(Project project) |
VcsShowSettingOption |
getOptions(VcsConfiguration.StandardOption option) |
VcsShowSettingOption |
getOrCreateCustomOption(java.lang.String vcsActionName,
AbstractVcs vcs) |
VcsRootChecker |
getRootChecker(AbstractVcs vcs) |
VirtualFile [] |
getRootsUnderVcs(AbstractVcs vcs) |
java.util.List<VirtualFile> |
getRootsUnderVcsWithoutFiltering(AbstractVcs vcs) |
VcsShowConfirmationOption |
getStandardConfirmation(VcsConfiguration.StandardConfirmation option,
AbstractVcs vcs) |
VcsShowSettingOption |
getStandardOption(VcsConfiguration.StandardOption option,
AbstractVcs vcs) |
Element |
getState() |
AbstractVcs |
getVcsFor(FilePath file)
Returns the VCS managing the specified file path.
|
AbstractVcs |
getVcsFor(VirtualFile file)
Returns the VCS managing the specified file.
|
VcsHistoryCache |
getVcsHistoryCache() |
VirtualFile |
getVcsRootFor(FilePath file)
Return the parent directory of the specified file path which is mapped to a VCS.
|
VirtualFile |
getVcsRootFor(VirtualFile file)
Return the parent directory of the specified file which is mapped to a VCS.
|
VcsRoot |
getVcsRootObjectFor(FilePath file) |
VcsRoot |
getVcsRootObjectFor(VirtualFile file) |
boolean |
hasActiveVcss() |
boolean |
hasAnyMappings() |
java.lang.String |
haveDefaultMapping() |
boolean |
haveVcses() |
boolean |
isBackgroundVcsOperationRunning()
Checks if a background VCS operation (commit or update) is currently in progress.
|
boolean |
isFileInContent(VirtualFile vf) |
boolean |
isIgnored(FilePath filePath) |
boolean |
isIgnored(VirtualFile vf) |
void |
iterateVcsRoot(VirtualFile root,
Processor<? super FilePath> iterator) |
void |
iterateVcsRoot(VirtualFile root,
Processor<? super FilePath> iterator,
VirtualFileFilter directoryFilter) |
void |
iterateVfUnderVcsRoot(VirtualFile file,
Processor<? super VirtualFile> processor) |
void |
loadState(Element state)
This method is called when new component state is loaded.
|
boolean |
needAutodetectMappings()
Returns 'true' during initial project setup, ie:
There are no explicitly configured mappings (
setDirectoryMapping(java.lang.String, java.lang.String) vs setAutoDirectoryMappings(java.util.List<? extends com.intellij.openapi.vcs.VcsDirectoryMapping>) )
There are no mappings inherited from "Default Project" configuration (excluding <Project> mappings) (myMappingsLoaded
Project was not reopened a second time (ATTRIBUTE_DEFAULT_PROJECT )
|
void |
notifyDirectoryMappingChanged() |
void |
registerVcs(AbstractVcs vcs) |
void |
removeDirectoryMapping(VcsDirectoryMapping mapping) |
void |
removeVcsListener(VcsListener listener)
Removes a listener for receiving notifications about changes in VCS configuration for the project.
|
void |
scheduleMappedRootsUpdate() |
void |
setAutoDirectoryMapping(java.lang.String path,
java.lang.String activeVcsName)
Deprecated.
|
void |
setAutoDirectoryMappings(java.util.List<? extends VcsDirectoryMapping> mappings) |
void |
setDirectoryMapping(java.lang.String path,
java.lang.String activeVcsName)
This method can be used only when initially loading the project configuration!
|
void |
setDirectoryMappings(java.util.List<VcsDirectoryMapping> items) |
void |
showProjectOperationInfo(UpdatedFiles updatedFiles,
java.lang.String displayActionName) |
UpdateInfoTree |
showUpdateProjectInfo(UpdatedFiles updatedFiles,
java.lang.String displayActionName,
ActionInfo actionInfo,
boolean canceled) |
void |
startBackgroundVcsOperation()
Marks the beginning of a background VCS operation (commit or update).
|
void |
stopBackgroundVcsOperation()
Marks the end of a background VCS operation (commit or update).
|
void |
unregisterVcs(AbstractVcs vcs) |
void |
waitForInitialized() |
getInstanceEx
getInstance, getInstanceChecked, updateActiveVcss
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initializeComponent, noStateLoaded
public ProjectLevelVcsManagerImpl(Project project)
public static ProjectLevelVcsManagerImpl getInstanceImpl(Project project)
public void registerVcs(AbstractVcs vcs)
public AbstractVcs findVcsByName(java.lang.String name)
ProjectLevelVcsManager
findVcsByName
in class ProjectLevelVcsManager
null
if none was found.public VcsDescriptor getDescriptor(java.lang.String name)
getDescriptor
in class ProjectLevelVcsManager
public void iterateVfUnderVcsRoot(VirtualFile file, Processor<? super VirtualFile> processor)
iterateVfUnderVcsRoot
in class ProjectLevelVcsManager
public VcsDescriptor[] getAllVcss()
ProjectLevelVcsManager
getAllVcss
in class ProjectLevelVcsManager
public boolean haveVcses()
public void dispose()
Disposable
dispose
in interface Disposable
public VcsAnnotationLocalChangesListener getAnnotationLocalChangesListener()
getAnnotationLocalChangesListener
in class ProjectLevelVcsManager
public boolean checkAllFilesAreUnder(AbstractVcs abstractVcs, VirtualFile[] files)
ProjectLevelVcsManager
checkAllFilesAreUnder
in class ProjectLevelVcsManager
public AbstractVcs getVcsFor(VirtualFile file)
ProjectLevelVcsManager
getVcsFor
in class ProjectLevelVcsManager
null
if the file does not belong to any module or the module
it belongs to is not under version control.public AbstractVcs getVcsFor(FilePath file)
ProjectLevelVcsManager
getVcsFor
in class ProjectLevelVcsManager
null
if the file does not belong to any module or the module
it belongs to is not under version control.public VirtualFile getVcsRootFor(VirtualFile file)
ProjectLevelVcsManager
getVcsRootFor
in class ProjectLevelVcsManager
null
if the specified file is not in a VCS-managed directory.public VcsRoot getVcsRootObjectFor(VirtualFile file)
getVcsRootObjectFor
in class ProjectLevelVcsManager
public VirtualFile getVcsRootFor(FilePath file)
ProjectLevelVcsManager
getVcsRootFor
in class ProjectLevelVcsManager
null
if the specified file is not in a VCS-managed directory.public VcsRoot getVcsRootObjectFor(FilePath file)
getVcsRootObjectFor
in class ProjectLevelVcsManager
public void unregisterVcs(AbstractVcs vcs)
public ContentManager getContentManager()
getContentManager
in class ProjectLevelVcsManagerEx
public boolean checkVcsIsActive(AbstractVcs vcs)
ProjectLevelVcsManager
checkVcsIsActive
in class ProjectLevelVcsManager
public boolean checkVcsIsActive(java.lang.String vcsName)
ProjectLevelVcsManager
checkVcsIsActive
in class ProjectLevelVcsManager
public AbstractVcs [] getAllActiveVcss()
ProjectLevelVcsManager
getAllActiveVcss
in class ProjectLevelVcsManager
public boolean hasActiveVcss()
hasActiveVcss
in class ProjectLevelVcsManager
public boolean hasAnyMappings()
hasAnyMappings
in class ProjectLevelVcsManager
@Deprecated public void addMessageToConsoleWindow(java.lang.String message, TextAttributes attributes)
addMessageToConsoleWindow
in class ProjectLevelVcsManager
public void addMessageToConsoleWindow(java.lang.String message, ConsoleViewContentType contentType)
addMessageToConsoleWindow
in class ProjectLevelVcsManager
public VcsShowSettingOption getOptions(VcsConfiguration.StandardOption option)
getOptions
in class ProjectLevelVcsManagerEx
public java.util.List<VcsShowOptionsSettingImpl> getAllOptions()
getAllOptions
in class ProjectLevelVcsManagerEx
public VcsShowSettingOption getStandardOption(VcsConfiguration.StandardOption option, AbstractVcs vcs)
getStandardOption
in class ProjectLevelVcsManager
public VcsShowSettingOption getOrCreateCustomOption(java.lang.String vcsActionName, AbstractVcs vcs)
getOrCreateCustomOption
in class ProjectLevelVcsManager
public void showProjectOperationInfo(UpdatedFiles updatedFiles, java.lang.String displayActionName)
showProjectOperationInfo
in class ProjectLevelVcsManager
public UpdateInfoTree showUpdateProjectInfo(UpdatedFiles updatedFiles, java.lang.String displayActionName, ActionInfo actionInfo, boolean canceled)
showUpdateProjectInfo
in class ProjectLevelVcsManagerEx
public java.util.List<VcsDirectoryMapping> getDirectoryMappings()
getDirectoryMappings
in class ProjectLevelVcsManager
public java.util.List<VcsDirectoryMapping> getDirectoryMappings(AbstractVcs vcs)
getDirectoryMappings
in class ProjectLevelVcsManager
public VcsDirectoryMapping getDirectoryMappingFor(FilePath file)
getDirectoryMappingFor
in class ProjectLevelVcsManager
public void setDirectoryMapping(java.lang.String path, java.lang.String activeVcsName)
ProjectLevelVcsManager
setDirectoryMapping
in class ProjectLevelVcsManager
@Deprecated public void setAutoDirectoryMapping(java.lang.String path, java.lang.String activeVcsName)
setAutoDirectoryMappings(List)
public void setAutoDirectoryMappings(java.util.List<? extends VcsDirectoryMapping> mappings)
public void removeDirectoryMapping(VcsDirectoryMapping mapping)
public void setDirectoryMappings(java.util.List<VcsDirectoryMapping> items)
setDirectoryMappings
in class ProjectLevelVcsManager
public void scheduleMappedRootsUpdate()
scheduleMappedRootsUpdate
in class ProjectLevelVcsManagerEx
public void iterateVcsRoot(VirtualFile root, Processor<? super FilePath> iterator)
iterateVcsRoot
in class ProjectLevelVcsManager
public void iterateVcsRoot(VirtualFile root, Processor<? super FilePath> iterator, VirtualFileFilter directoryFilter)
iterateVcsRoot
in class ProjectLevelVcsManager
public Element getState()
getState
in interface PersistentStateComponent<Element>
null
value indicates
that the returned state won't be stored, as a result previously stored state will be used.XmlSerializer
public void loadState(Element state)
PersistentStateComponent
State object should be used directly, defensive copying is not required.
loadState
in interface PersistentStateComponent<Element>
state
- loaded component stateXmlSerializerUtil.copyBean(Object, Object)
public VcsShowConfirmationOption getStandardConfirmation(VcsConfiguration.StandardConfirmation option, AbstractVcs vcs)
getStandardConfirmation
in class ProjectLevelVcsManager
public java.util.List<VcsShowConfirmationOptionImpl> getAllConfirmations()
getAllConfirmations
in class ProjectLevelVcsManagerEx
public VcsShowConfirmationOptionImpl getConfirmation(VcsConfiguration.StandardConfirmation option)
getConfirmation
in class ProjectLevelVcsManagerEx
public void addVcsListener(VcsListener listener)
ProjectLevelVcsManager
addVcsListener
in class ProjectLevelVcsManager
public void removeVcsListener(VcsListener listener)
ProjectLevelVcsManager
removeVcsListener
in class ProjectLevelVcsManager
public void startBackgroundVcsOperation()
ProjectLevelVcsManager
startBackgroundVcsOperation
in class ProjectLevelVcsManager
public void stopBackgroundVcsOperation()
ProjectLevelVcsManager
stopBackgroundVcsOperation
in class ProjectLevelVcsManager
public boolean isBackgroundVcsOperationRunning()
ProjectLevelVcsManager
isBackgroundVcsOperationRunning
in class ProjectLevelVcsManager
public java.util.List<VirtualFile> getRootsUnderVcsWithoutFiltering(AbstractVcs vcs)
getRootsUnderVcsWithoutFiltering
in class ProjectLevelVcsManager
public VirtualFile [] getRootsUnderVcs(AbstractVcs vcs)
getRootsUnderVcs
in class ProjectLevelVcsManager
public java.util.List<VirtualFile> getDetailedVcsMappings(AbstractVcs vcs)
ProjectLevelVcsManager
getDetailedVcsMappings
in class ProjectLevelVcsManager
public VirtualFile[] getAllVersionedRoots()
getAllVersionedRoots
in class ProjectLevelVcsManager
public VcsRoot [] getAllVcsRoots()
getAllVcsRoots
in class ProjectLevelVcsManager
public void notifyDirectoryMappingChanged()
notifyDirectoryMappingChanged
in class ProjectLevelVcsManagerEx
public boolean needAutodetectMappings()
setDirectoryMapping(java.lang.String, java.lang.String)
vs setAutoDirectoryMappings(java.util.List<? extends com.intellij.openapi.vcs.VcsDirectoryMapping>)
)
myMappingsLoaded
ATTRIBUTE_DEFAULT_PROJECT
)
public AbstractVcs findVersioningVcs(VirtualFile file)
findVersioningVcs
in class ProjectLevelVcsManager
public VcsRootChecker getRootChecker(AbstractVcs vcs)
getRootChecker
in class ProjectLevelVcsManager
public CheckoutProvider.Listener getCompositeCheckoutListener()
getCompositeCheckoutListener
in class ProjectLevelVcsManager
public void fireDirectoryMappingsChanged()
fireDirectoryMappingsChanged
in class ProjectLevelVcsManagerEx
public java.lang.String haveDefaultMapping()
haveDefaultMapping
in class ProjectLevelVcsManagerEx
@Deprecated public BackgroundableActionEnabledHandler getBackgroundableActionHandler(VcsBackgroundableActions action)
BackgroundableActionLock
public void addInitializationRequest(VcsInitObject vcsInitObject, java.lang.Runnable runnable)
public boolean isFileInContent(VirtualFile vf)
isFileInContent
in class ProjectLevelVcsManager
public boolean isIgnored(VirtualFile vf)
isIgnored
in class ProjectLevelVcsManager
public boolean isIgnored(FilePath filePath)
isIgnored
in class ProjectLevelVcsManager
public VcsHistoryCache getVcsHistoryCache()
getVcsHistoryCache
in class ProjectLevelVcsManager
public ContentRevisionCache getContentRevisionCache()
getContentRevisionCache
in class ProjectLevelVcsManager
public void waitForInitialized()