use of com.intellij.openapi.vcs.changes.LocalChangeList in project intellij-community by JetBrains.
the class ChangeListChooserPanel method setSuggestedName.
public void setSuggestedName(@NotNull String name) {
if (StringUtil.isEmptyOrSpaces(name))
return;
LocalChangeList changelistByName = getExistingChangelistByName(name);
if (changelistByName != null) {
myExistingListsCombo.setSelectedItem(changelistByName);
} else {
myNewNameSuggested = true;
if (VcsConfiguration.getInstance(myProject).PRESELECT_EXISTING_CHANGELIST) {
myExistingListsCombo.insertItemAt(LocalChangeList.createEmptyChangeList(myProject, name), 0);
selectActiveChangeListIfExist();
} else {
myListPanel.setChangeListName(name);
}
}
updateDescription();
}
use of com.intellij.openapi.vcs.changes.LocalChangeList in project intellij-community by JetBrains.
the class VcsHandleType method processFiles.
public void processFiles(final Collection<VirtualFile> files, @Nullable final String changelist) {
try {
EditFileProvider provider = myVcs.getEditFileProvider();
assert provider != null;
provider.editFiles(VfsUtil.toVirtualFileArray(files));
} catch (VcsException e) {
Messages.showErrorDialog(VcsBundle.message("message.text.cannot.edit.file", e.getLocalizedMessage()), VcsBundle.message("message.title.edit.files"));
}
ApplicationManager.getApplication().runWriteAction(new Runnable() {
public void run() {
for (final VirtualFile file : files) {
file.refresh(false, false);
}
}
});
if (changelist != null) {
myChangeListManager.invokeAfterUpdate(new Runnable() {
@Override
public void run() {
LocalChangeList list = myChangeListManager.findChangeList(changelist);
if (list != null) {
List<Change> changes = ContainerUtil.mapNotNull(files, myChangeFunction);
myChangeListManager.moveChangesTo(list, changes.toArray(new Change[changes.size()]));
}
}
}, InvokeAfterUpdateMode.SILENT, "", ModalityState.NON_MODAL);
}
}
use of com.intellij.openapi.vcs.changes.LocalChangeList in project intellij-community by JetBrains.
the class RemoveChangeListAction method actionPerformed.
public void actionPerformed(@NotNull AnActionEvent e) {
final Project project = e.getRequiredData(CommonDataKeys.PROJECT);
final ChangeList[] selectedLists = e.getRequiredData(VcsDataKeys.CHANGE_LISTS);
//noinspection unchecked
ChangeListRemoveConfirmation.processLists(project, true, (Collection) Arrays.asList(selectedLists), new ChangeListRemoveConfirmation() {
@Override
public boolean askIfShouldRemoveChangeLists(@NotNull List<? extends LocalChangeList> lists) {
return RemoveChangeListAction.askIfShouldRemoveChangeLists(lists, project);
}
});
}
use of com.intellij.openapi.vcs.changes.LocalChangeList in project intellij-community by JetBrains.
the class MoveChanges method doNotify.
public void doNotify(final EventDispatcher<ChangeListListener> dispatcher) {
if ((myMovedFrom != null) && (myListCopy != null)) {
for (LocalChangeList fromList : myMovedFrom.keySet()) {
final Collection<Change> changesInList = myMovedFrom.get(fromList);
dispatcher.getMulticaster().changesMoved(changesInList, fromList, myListCopy);
}
}
}
use of com.intellij.openapi.vcs.changes.LocalChangeList in project intellij-community by JetBrains.
the class EditName method apply.
public void apply(final ChangeListWorker worker) {
final LocalChangeList fromList = worker.getCopyByName(myFromName);
if (fromList != null && (!fromList.isReadOnly())) {
myResult = worker.editName(myFromName, myToName);
myListCopy = worker.getCopyByName(myToName);
}
}
Aggregations