use of com.intellij.openapi.vcs.versionBrowser.CommittedChangeList in project intellij-community by JetBrains.
the class ChangesCacheFile method editChangelist.
public void editChangelist(long number, String message) throws IOException {
final List<CommittedChangeList> lists = new ArrayList<>();
final List<Boolean> present = loadAllData(lists);
for (CommittedChangeList list : lists) {
if (list.getNumber() == number) {
list.setDescription(message);
break;
}
}
delete();
Collections.reverse(lists);
Collections.reverse(present);
writeChanges(lists, present);
}
use of com.intellij.openapi.vcs.versionBrowser.CommittedChangeList in project intellij-community by JetBrains.
the class ColumnFilteringStrategy method filterChangeLists.
@NotNull
public List<CommittedChangeList> filterChangeLists(List<CommittedChangeList> changeLists) {
final Object[] selection = myValueList.getSelectedValues();
if (myValueList.getSelectedIndex() == 0 || selection.length == 0) {
return changeLists;
}
List<CommittedChangeList> result = new ArrayList<>();
for (CommittedChangeList changeList : changeLists) {
if (myProviderClass == null || myProviderClass.isInstance(changeList.getVcs().getCommittedChangesProvider())) {
for (Object value : selection) {
//noinspection unchecked
if (value.toString().equals(myColumn.getValue(ReceivedChangeList.unwrap(changeList)).toString())) {
result.add(changeList);
break;
}
}
}
}
return result;
}
use of com.intellij.openapi.vcs.versionBrowser.CommittedChangeList in project intellij-community by JetBrains.
the class CommittedChangeListRenderer method customize.
public void customize(JComponent tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) value;
if (node.getUserObject() instanceof CommittedChangeList) {
CommittedChangeList changeList = (CommittedChangeList) node.getUserObject();
renderChangeList(tree, changeList);
} else if (node.getUserObject() != null) {
append(node.getUserObject().toString(), SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES);
}
}
use of com.intellij.openapi.vcs.versionBrowser.CommittedChangeList in project intellij-community by JetBrains.
the class GetCommittedChangelistAction method actionPerformed.
@Override
protected void actionPerformed(@NotNull final VcsContext context) {
Collection<FilePath> filePaths = getFilePaths(context);
final List<ChangeList> selectedChangeLists = new ArrayList<>();
final ChangeList[] selectionFromContext = context.getSelectedChangeLists();
if (selectionFromContext != null) {
Collections.addAll(selectedChangeLists, selectionFromContext);
}
final List<CommittedChangeList> incomingChanges = CommittedChangesCache.getInstance(context.getProject()).getCachedIncomingChanges();
final List<CommittedChangeList> intersectingChanges = new ArrayList<>();
if (incomingChanges != null) {
for (CommittedChangeList changeList : incomingChanges) {
if (!selectedChangeLists.contains(changeList)) {
for (Change change : changeList.getChanges()) {
if (filePaths.contains(ChangesUtil.getFilePath(change))) {
intersectingChanges.add(changeList);
break;
}
}
}
}
}
if (intersectingChanges.size() > 0) {
int rc = Messages.showOkCancelDialog(context.getProject(), VcsBundle.message("get.committed.changes.intersecting.prompt", intersectingChanges.size(), selectedChangeLists.size()), VcsBundle.message("get.committed.changes.title"), Messages.getQuestionIcon());
if (rc != Messages.OK)
return;
}
super.actionPerformed(context);
}
use of com.intellij.openapi.vcs.versionBrowser.CommittedChangeList in project intellij-community by JetBrains.
the class OutdatedVersionNotifier method updateAllEditors.
private void updateAllEditors() {
if (myCache.getCachedIncomingChanges() == null) {
requestLoadIncomingChanges();
return;
}
debug("Updating editors");
final VirtualFile[] files = myFileEditorManager.getOpenFiles();
for (VirtualFile file : files) {
final Pair<CommittedChangeList, Change> pair = myCache.getIncomingChangeList(file);
final FileEditor[] fileEditors = myFileEditorManager.getEditors(file);
for (FileEditor editor : fileEditors) {
final OutdatedRevisionPanel oldPanel = editor.getUserData(PANEL_KEY);
if (pair != null) {
if (oldPanel != null) {
oldPanel.setChangeList(pair.first, pair.second);
} else {
initPanel(pair.first, pair.second, editor);
}
} else if (oldPanel != null) {
myFileEditorManager.removeTopComponent(editor, oldPanel);
editor.putUserData(PANEL_KEY, null);
}
}
}
}
Aggregations