use of com.intellij.openapi.vcs.changes.ChangeList in project intellij-community by JetBrains.
the class CommitCompletionContributor method fillCompletionVariants.
@Override
public void fillCompletionVariants(@NotNull CompletionParameters parameters, @NotNull CompletionResultSet result) {
PsiFile file = parameters.getOriginalFile();
Document document = PsiDocumentManager.getInstance(file.getProject()).getDocument(file);
if (document == null)
return;
CommitMessage commitMessage = document.getUserData(CommitMessage.DATA_KEY);
if (commitMessage == null)
return;
result.stopHere();
if (parameters.getInvocationCount() <= 0)
return;
List<ChangeList> lists = commitMessage.getChangeLists();
if (lists.isEmpty())
return;
String prefix = TextFieldWithAutoCompletionListProvider.getCompletionPrefix(parameters);
CompletionResultSet insensitive = result.caseInsensitive().withPrefixMatcher(new CamelHumpMatcher(prefix));
for (ChangeList list : lists) {
for (Change change : list.getChanges()) {
ContentRevision revision = change.getAfterRevision() == null ? change.getBeforeRevision() : change.getAfterRevision();
if (revision != null) {
FilePath filePath = revision.getFile();
LookupElementBuilder element = LookupElementBuilder.create(filePath.getName()).withIcon(filePath.getFileType().getIcon());
insensitive.addElement(element);
}
}
}
}
use of com.intellij.openapi.vcs.changes.ChangeList in project intellij-community by JetBrains.
the class ChangeListDetailsAction method actionPerformed.
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
Project project = e.getRequiredData(PROJECT);
ChangeList[] changeLists = e.getRequiredData(CHANGE_LISTS);
showDetailsPopup(project, (CommittedChangeList) changeLists[0]);
}
use of com.intellij.openapi.vcs.changes.ChangeList in project intellij-community by JetBrains.
the class SetDefaultChangeListAction method actionPerformed.
public void actionPerformed(AnActionEvent e) {
Project project = e.getData(CommonDataKeys.PROJECT);
final ChangeList[] lists = e.getData(VcsDataKeys.CHANGE_LISTS);
assert lists != null;
ChangeListManager.getInstance(project).setDefaultChangeList((LocalChangeList) lists[0]);
}
use of com.intellij.openapi.vcs.changes.ChangeList in project intellij-community by JetBrains.
the class RenameChangeListAction method actionPerformed.
public void actionPerformed(AnActionEvent e) {
Project project = e.getData(CommonDataKeys.PROJECT);
ChangeList[] lists = e.getData(VcsDataKeys.CHANGE_LISTS);
assert lists != null;
final LocalChangeList list = ChangeListManager.getInstance(project).findChangeList(lists[0].getName());
if (list != null) {
new EditChangelistDialog(project, list).show();
}
}
use of com.intellij.openapi.vcs.changes.ChangeList in project intellij-community by JetBrains.
the class SvnEditCommitMessageAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
final DataContext dc = e.getDataContext();
final ChangeList[] lists = VcsDataKeys.CHANGE_LISTS.getData(dc);
final boolean enabled = lists != null && lists.length == 1 && lists[0] instanceof SvnChangeList;
if (!enabled)
return;
final SvnChangeList svnList = (SvnChangeList) lists[0];
Project project = CommonDataKeys.PROJECT.getData(dc);
project = project == null ? ProjectManager.getInstance().getDefaultProject() : project;
final Consumer<String> listener = VcsDataKeys.REMOTE_HISTORY_CHANGED_LISTENER.getData(dc);
askAndEditRevision(svnList.getNumber(), svnList.getComment(), svnList.getLocation(), project, listener, false);
}
Aggregations