public class ChangeListManagerImpl extends ChangeListManagerEx implements ChangeListOwner, PersistentStateComponent<Element>
Modifier and Type | Class and Description |
---|---|
static class |
ChangeListManagerImpl.DefaultIgnoredFileProvider |
Modifier and Type | Field and Description |
---|---|
static Topic<LocalChangeListsLoadedListener> |
LISTS_LOADED |
Constructor and Description |
---|
ChangeListManagerImpl(Project project) |
Modifier and Type | Method and Description |
---|---|
LocalChangeList |
addChangeList(java.lang.String name,
java.lang.String comment) |
LocalChangeList |
addChangeList(java.lang.String name,
java.lang.String comment,
ChangeListData data) |
void |
addChangeListListener(ChangeListListener listener)
Prefer using
ChangeListListener.TOPIC |
void |
addChangeListListener(ChangeListListener listener,
Disposable disposable)
Prefer using
ChangeListListener.TOPIC |
void |
addDirectoryToIgnoreImplicitly(java.lang.String path) |
void |
addFilesToIgnore(IgnoredFileBean... filesToIgnore) |
void |
addUnversionedFiles(LocalChangeList list,
java.util.List<? extends VirtualFile> files) |
void |
blockModalNotifications()
Blocks modal dialogs that we don't want to popup during some process, for example, above the commit dialog.
|
void |
commitChanges(LocalChangeList changeList,
java.util.List<? extends Change> changes) |
void |
commitChangesSynchronouslyWithResult(LocalChangeList changeList,
java.util.List<? extends Change> changes) |
boolean |
editChangeListData(java.lang.String name,
ChangeListData newData) |
java.lang.String |
editComment(java.lang.String name,
java.lang.String newComment) |
boolean |
editName(java.lang.String fromName,
java.lang.String toName) |
boolean |
ensureUpToDate() |
void |
executeOnUpdaterThread(java.lang.Runnable r) |
void |
executeUnderDataLock(java.lang.Runnable r) |
LocalChangeList |
findChangeList(java.lang.String name) |
void |
forceGoInTestMode() |
void |
forceStopInTestMode() |
void |
freeze(java.lang.String reason)
Temporarily disable CLM update
For example, to preserve FilePath->ChangeList mapping during "stash-do_smth-unstash" routine.
|
java.util.List<VirtualFile> |
getAffectedFiles() |
java.util.List<LocalChangeList> |
getAffectedLists(java.util.Collection<? extends Change> changes) |
java.util.List<java.io.File> |
getAffectedPaths() |
java.util.Collection<Change> |
getAllChanges() |
Change |
getChange(FilePath file) |
Change |
getChange(VirtualFile file) |
LocalChangeList |
getChangeList(Change change) |
LocalChangeList |
getChangeList(java.lang.String id) |
LocalChangeList |
getChangeList(VirtualFile file) |
java.lang.String |
getChangeListNameIfOnlyOne(Change[] changes) |
java.util.List<LocalChangeList> |
getChangeLists() |
java.util.List<LocalChangeList> |
getChangeLists(Change change) |
java.util.List<LocalChangeList> |
getChangeLists(VirtualFile file) |
int |
getChangeListsNumber() |
java.util.Collection<Change> |
getChangesIn(FilePath dirPath) |
java.util.Collection<Change> |
getChangesIn(VirtualFile dir) |
ChangelistConflictTracker |
getConflictTracker() |
LocalChangeList |
getDefaultChangeList()
Currently active change list.
|
java.lang.String |
getDefaultListName() |
java.util.List<LocallyDeletedChange> |
getDeletedFiles() |
IgnoredFileBean [] |
getFilesToIgnore() |
java.util.List<FilePath> |
getIgnoredFilePaths() |
java.util.List<VirtualFile> |
getIgnoredFiles()
Deprecated.
|
static ChangeListManagerImpl |
getInstanceImpl(Project project) |
java.util.List<VirtualFile> |
getLockedFolders() |
java.util.List<VirtualFile> |
getModifiedWithoutEditing() |
Project |
getProject() |
java.util.List<CommitExecutor> |
getRegisteredExecutors() |
Element |
getState() |
FileStatus |
getStatus(FilePath path) |
FileStatus |
getStatus(VirtualFile file) |
java.lang.String |
getSwitchedBranch(VirtualFile file) |
java.util.List<VirtualFile> |
getUnversionedFiles()
Deprecated.
|
java.util.List<FilePath> |
getUnversionedFilesPaths() |
VcsException |
getUpdateException() |
AbstractVcs |
getVcsFor(Change change) |
ThreeState |
haveChangesUnder(VirtualFile vf) |
void |
invokeAfterUpdate(java.lang.Runnable afterUpdate,
InvokeAfterUpdateMode mode,
java.lang.String title,
Consumer<? super VcsDirtyScopeManager> dirtyScopeManagerFiller,
ModalityState state) |
void |
invokeAfterUpdate(java.lang.Runnable afterUpdate,
InvokeAfterUpdateMode mode,
java.lang.String title,
ModalityState state)
update itself might produce actions done on AWT thread (invoked-after),
so waiting for its completion on AWT thread is not good runnable is invoked on AWT thread
|
boolean |
isContainedInLocallyDeleted(FilePath filePath) |
boolean |
isFileAffected(VirtualFile file) |
java.lang.String |
isFreezed() |
boolean |
isFreezedWithNotification(java.lang.String modalTitle) |
boolean |
isIgnoredFile(FilePath file) |
boolean |
isIgnoredFile(VirtualFile file) |
boolean |
isInUpdate() |
boolean |
isLogicallyLocked(VirtualFile file) |
static boolean |
isUnder(Change change,
VcsDirtyScope scope) |
boolean |
isUnversioned(VirtualFile file) |
void |
loadState(Element element)
This method is called when new component state is loaded.
|
void |
moveChangesTo(LocalChangeList list,
Change... changes) |
void |
notifyChangelistsChanged(FilePath path,
java.util.List<java.lang.String> beforeChangeListsIds,
java.util.List<java.lang.String> afterChangeListsIds) |
void |
registerChangeTracker(FilePath filePath,
ChangeListWorker.PartialChangeTracker tracker) |
void |
registerCommitExecutor(CommitExecutor executor) |
void |
removeChangeList(LocalChangeList list) |
void |
removeChangeList(java.lang.String name) |
void |
removeChangeListListener(ChangeListListener listener) |
void |
removeImplicitlyIgnoredDirectory(java.lang.String path) |
void |
reopenFiles(java.util.List<? extends FilePath> paths) |
void |
replaceCommitMessage(java.lang.String oldMessage,
java.lang.String newMessage) |
void |
scheduleAutomaticEmptyChangeListDeletion(LocalChangeList list) |
void |
scheduleAutomaticEmptyChangeListDeletion(LocalChangeList oldList,
boolean silently) |
void |
scheduleUnversionedUpdate() |
void |
scheduleUpdate() |
void |
setDefaultChangeList(LocalChangeList list) |
void |
setDefaultChangeList(LocalChangeList list,
boolean automatic) |
void |
setDefaultChangeList(java.lang.String name) |
void |
setDefaultChangeList(java.lang.String name,
boolean automatic) |
void |
setFilesToIgnore(IgnoredFileBean... filesToIgnore) |
boolean |
setReadOnly(java.lang.String name,
boolean value)
Prohibit changelist deletion or rename until Project is closed
|
void |
showLocalChangesInvalidated() |
static boolean |
showRemoveEmptyChangeListsProposal(Project project,
VcsConfiguration config,
java.util.Collection<? extends ChangeList> lists)
Shows the proposal to delete one or more changelists that were default and became empty.
|
void |
stopEveryThingIfInTestMode() |
void |
unblockModalNotifications() |
void |
unfreeze() |
void |
unregisterChangeTracker(FilePath filePath,
ChangeListWorker.PartialChangeTracker tracker) |
void |
waitEverythingDoneInTestMode() |
void |
waitForUpdate(java.lang.String operationName)
Simulate synchronous task execution.
|
void |
waitUntilRefreshed() |
getChangeListsCopy, getInstance, scheduleUpdate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initializeComponent, noStateLoaded
public static final Topic<LocalChangeListsLoadedListener> LISTS_LOADED
public ChangeListManagerImpl(Project project)
public static ChangeListManagerImpl getInstanceImpl(Project project)
public void scheduleAutomaticEmptyChangeListDeletion(LocalChangeList list)
scheduleAutomaticEmptyChangeListDeletion
in class ChangeListManager
public void scheduleAutomaticEmptyChangeListDeletion(LocalChangeList oldList, boolean silently)
scheduleAutomaticEmptyChangeListDeletion
in class ChangeListManager
public static boolean showRemoveEmptyChangeListsProposal(Project project, VcsConfiguration config, java.util.Collection<? extends ChangeList> lists)
public void blockModalNotifications()
ChangeListManagerEx
blockModalNotifications
in class ChangeListManagerEx
public void unblockModalNotifications()
unblockModalNotifications
in class ChangeListManagerEx
public void registerChangeTracker(FilePath filePath, ChangeListWorker.PartialChangeTracker tracker)
public void unregisterChangeTracker(FilePath filePath, ChangeListWorker.PartialChangeTracker tracker)
public void invokeAfterUpdate(java.lang.Runnable afterUpdate, InvokeAfterUpdateMode mode, java.lang.String title, ModalityState state)
invokeAfterUpdate
in class ChangeListManager
public void invokeAfterUpdate(java.lang.Runnable afterUpdate, InvokeAfterUpdateMode mode, java.lang.String title, Consumer<? super VcsDirtyScopeManager> dirtyScopeManagerFiller, ModalityState state)
invokeAfterUpdate
in class ChangeListManager
public void freeze(java.lang.String reason)
ChangeListManagerEx
freeze
in class ChangeListManagerEx
public void unfreeze()
unfreeze
in class ChangeListManagerEx
public void waitForUpdate(java.lang.String operationName)
ChangeListManagerEx
waitForUpdate
in class ChangeListManagerEx
public java.lang.String isFreezed()
isFreezed
in class ChangeListManager
public void executeOnUpdaterThread(java.lang.Runnable r)
public void executeUnderDataLock(java.lang.Runnable r)
public void scheduleUpdate()
scheduleUpdate
in class ChangeListManager
public static boolean isUnder(Change change, VcsDirtyScope scope)
public java.util.List<LocalChangeList> getChangeLists()
getChangeLists
in class ChangeListManager
public java.util.List<java.io.File> getAffectedPaths()
getAffectedPaths
in class ChangeListManager
public java.util.List<VirtualFile> getAffectedFiles()
getAffectedFiles
in class ChangeListManager
public java.util.Collection<Change> getAllChanges()
getAllChanges
in class ChangeListManager
@Deprecated public java.util.List<VirtualFile> getUnversionedFiles()
getUnversionedFilesPaths()
public java.util.List<FilePath> getUnversionedFilesPaths()
public java.util.List<VirtualFile> getModifiedWithoutEditing()
getModifiedWithoutEditing
in class ChangeListManager
@Deprecated public java.util.List<VirtualFile> getIgnoredFiles()
getIgnoredFilePaths()
public java.util.List<FilePath> getIgnoredFilePaths()
public java.util.List<VirtualFile> getLockedFolders()
public boolean isLogicallyLocked(VirtualFile file)
public boolean isContainedInLocallyDeleted(FilePath filePath)
public java.util.List<LocallyDeletedChange> getDeletedFiles()
public VcsException getUpdateException()
public boolean isFileAffected(VirtualFile file)
isFileAffected
in class ChangeListManager
public LocalChangeList findChangeList(java.lang.String name)
findChangeList
in class ChangeListManager
public LocalChangeList getChangeList(java.lang.String id)
getChangeList
in class ChangeListManager
public LocalChangeList addChangeList(java.lang.String name, java.lang.String comment)
addChangeList
in interface ChangeListModification
public LocalChangeList addChangeList(java.lang.String name, java.lang.String comment, ChangeListData data)
addChangeList
in class ChangeListManagerEx
public void removeChangeList(java.lang.String name)
removeChangeList
in interface ChangeListModification
public void removeChangeList(LocalChangeList list)
removeChangeList
in interface ChangeListModification
public void setDefaultChangeList(java.lang.String name, boolean automatic)
public void setDefaultChangeList(java.lang.String name)
setDefaultChangeList
in interface ChangeListModification
public void setDefaultChangeList(LocalChangeList list)
setDefaultChangeList
in interface ChangeListModification
public void setDefaultChangeList(LocalChangeList list, boolean automatic)
setDefaultChangeList
in class ChangeListManagerEx
automatic
- true is changelist switch operation was not triggered by user (and, for example, will be reverted soon)
4ex: This flag disables automatic empty changelist deletion.public boolean setReadOnly(java.lang.String name, boolean value)
ChangeListModification
setReadOnly
in interface ChangeListModification
public boolean editName(java.lang.String fromName, java.lang.String toName)
editName
in interface ChangeListModification
public java.lang.String editComment(java.lang.String name, java.lang.String newComment)
editComment
in interface ChangeListModification
public boolean editChangeListData(java.lang.String name, ChangeListData newData)
editChangeListData
in class ChangeListManagerEx
public void moveChangesTo(LocalChangeList list, Change... changes)
moveChangesTo
in interface ChangeListModification
moveChangesTo
in interface ChangeListOwner
public LocalChangeList getDefaultChangeList()
ChangeListManager
getDefaultChangeList
in class ChangeListManager
ChangeListModification.setDefaultChangeList(String)
,
ChangeListModification.setDefaultChangeList(LocalChangeList)
public java.lang.String getDefaultListName()
getDefaultListName
in class ChangeListManager
public void notifyChangelistsChanged(FilePath path, java.util.List<java.lang.String> beforeChangeListsIds, java.util.List<java.lang.String> afterChangeListsIds)
public java.lang.String getChangeListNameIfOnlyOne(Change[] changes)
getChangeListNameIfOnlyOne
in class ChangeListManager
public boolean isInUpdate()
isInUpdate
in class ChangeListManagerEx
public Change getChange(VirtualFile file)
getChange
in class ChangeListManager
public java.util.List<LocalChangeList> getAffectedLists(java.util.Collection<? extends Change> changes)
getAffectedLists
in class ChangeListManagerEx
public java.util.List<LocalChangeList> getChangeLists(Change change)
getChangeLists
in class ChangeListManager
public java.util.List<LocalChangeList> getChangeLists(VirtualFile file)
getChangeLists
in class ChangeListManager
public LocalChangeList getChangeList(Change change)
getChangeList
in class ChangeListManager
public LocalChangeList getChangeList(VirtualFile file)
getChangeList
in class ChangeListManager
public Change getChange(FilePath file)
getChange
in class ChangeListManager
public boolean isUnversioned(VirtualFile file)
isUnversioned
in class ChangeListManager
public FileStatus getStatus(FilePath path)
public FileStatus getStatus(VirtualFile file)
getStatus
in class ChangeListManager
public java.util.Collection<Change> getChangesIn(VirtualFile dir)
getChangesIn
in class ChangeListManager
public ThreeState haveChangesUnder(VirtualFile vf)
haveChangesUnder
in class ChangeListManager
public java.util.Collection<Change> getChangesIn(FilePath dirPath)
getChangesIn
in class ChangeListManager
public AbstractVcs getVcsFor(Change change)
getVcsFor
in class ChangeListManager
public void addUnversionedFiles(LocalChangeList list, java.util.List<? extends VirtualFile> files)
addUnversionedFiles
in interface ChangeListOwner
public Project getProject()
getProject
in interface ChangeListOwner
public void addChangeListListener(ChangeListListener listener, Disposable disposable)
ChangeListManager
ChangeListListener.TOPIC
addChangeListListener
in class ChangeListManager
public void addChangeListListener(ChangeListListener listener)
ChangeListManager
ChangeListListener.TOPIC
addChangeListListener
in class ChangeListManager
public void removeChangeListListener(ChangeListListener listener)
removeChangeListListener
in class ChangeListManager
public void registerCommitExecutor(CommitExecutor executor)
registerCommitExecutor
in class ChangeListManager
public void commitChanges(LocalChangeList changeList, java.util.List<? extends Change> changes)
commitChanges
in class ChangeListManager
public void commitChangesSynchronouslyWithResult(LocalChangeList changeList, java.util.List<? extends Change> changes)
public void loadState(Element element)
PersistentStateComponent
State object should be used directly, defensive copying is not required.
loadState
in interface PersistentStateComponent<Element>
element
- loaded component stateXmlSerializerUtil.copyBean(Object, Object)
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 reopenFiles(java.util.List<? extends FilePath> paths)
reopenFiles
in class ChangeListManager
public java.util.List<CommitExecutor> getRegisteredExecutors()
getRegisteredExecutors
in class ChangeListManager
public void addFilesToIgnore(IgnoredFileBean... filesToIgnore)
addFilesToIgnore
in class ChangeListManager
public void addDirectoryToIgnoreImplicitly(java.lang.String path)
addDirectoryToIgnoreImplicitly
in class ChangeListManager
public void removeImplicitlyIgnoredDirectory(java.lang.String path)
removeImplicitlyIgnoredDirectory
in class ChangeListManager
public void scheduleUnversionedUpdate()
public void setFilesToIgnore(IgnoredFileBean... filesToIgnore)
setFilesToIgnore
in class ChangeListManager
public IgnoredFileBean [] getFilesToIgnore()
getFilesToIgnore
in class ChangeListManager
public boolean isIgnoredFile(VirtualFile file)
isIgnoredFile
in class ChangeListManager
public boolean isIgnoredFile(FilePath file)
isIgnoredFile
in class ChangeListManager
public java.lang.String getSwitchedBranch(VirtualFile file)
getSwitchedBranch
in class ChangeListManager
public void waitUntilRefreshed()
public void stopEveryThingIfInTestMode()
public void waitEverythingDoneInTestMode()
public void forceStopInTestMode()
public void forceGoInTestMode()
public boolean ensureUpToDate()
public int getChangeListsNumber()
getChangeListsNumber
in class ChangeListManager
public void showLocalChangesInvalidated()
public ChangelistConflictTracker getConflictTracker()
public boolean isFreezedWithNotification(java.lang.String modalTitle)
isFreezedWithNotification
in class ChangeListManager
public void replaceCommitMessage(java.lang.String oldMessage, java.lang.String newMessage)