Search in sources :

Example 1 with VcsCommittedViewAuxiliary

use of com.intellij.openapi.vcs.changes.committed.VcsCommittedViewAuxiliary in project intellij-community by JetBrains.

the class HgCachingCommittedChangesProvider method createActions.

public VcsCommittedViewAuxiliary createActions(DecoratorManager decoratorManager, RepositoryLocation repositoryLocation) {
    AnAction copyHashAction = new AnAction("Copy &Hash", "Copy hash to clipboard", PlatformIcons.COPY_ICON) {

        @Override
        public void actionPerformed(AnActionEvent e) {
            ChangeList[] changeLists = e.getData(VcsDataKeys.CHANGE_LISTS);
            if (changeLists != null && changeLists[0] instanceof HgCommittedChangeList) {
                HgRevisionNumber revisionNumber = ((HgCommittedChangeList) changeLists[0]).getRevisionNumber();
                CopyPasteManager.getInstance().setContents(new StringSelection(revisionNumber.getChangeset()));
            }
        }
    };
    return new VcsCommittedViewAuxiliary(Collections.singletonList(copyHashAction), new Runnable() {

        public void run() {
        }
    }, Collections.singletonList(copyHashAction));
}
Also used : CommittedChangeList(com.intellij.openapi.vcs.versionBrowser.CommittedChangeList) ChangeList(com.intellij.openapi.vcs.changes.ChangeList) VcsCommittedViewAuxiliary(com.intellij.openapi.vcs.changes.committed.VcsCommittedViewAuxiliary) AnActionEvent(com.intellij.openapi.actionSystem.AnActionEvent) AnAction(com.intellij.openapi.actionSystem.AnAction) StringSelection(java.awt.datatransfer.StringSelection)

Example 2 with VcsCommittedViewAuxiliary

use of com.intellij.openapi.vcs.changes.committed.VcsCommittedViewAuxiliary in project intellij-community by JetBrains.

the class SvnCommittedChangesProvider method createActions.

@Override
@NotNull
public VcsCommittedViewAuxiliary createActions(@NotNull DecoratorManager manager, @Nullable RepositoryLocation location) {
    RootsAndBranches rootsAndBranches = new RootsAndBranches(myVcs, manager, location);
    refreshMergeInfo(rootsAndBranches);
    DefaultActionGroup popup = new DefaultActionGroup(myVcs.getDisplayName(), true);
    popup.add(rootsAndBranches.getIntegrateAction());
    popup.add(rootsAndBranches.getUndoIntegrateAction());
    popup.add(new ConfigureBranchesAction());
    ShowHideMergePanelAction action = new ShowHideMergePanelAction(manager, rootsAndBranches.getStrategy());
    return new VcsCommittedViewAuxiliary(singletonList(popup), () -> {
        if (myMergeInfoUpdatesListener != null) {
            myMergeInfoUpdatesListener.removePanel(rootsAndBranches);
            rootsAndBranches.dispose();
        }
    }, singletonList(action));
}
Also used : ConfigureBranchesAction(org.jetbrains.idea.svn.branchConfig.ConfigureBranchesAction) VcsCommittedViewAuxiliary(com.intellij.openapi.vcs.changes.committed.VcsCommittedViewAuxiliary) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

VcsCommittedViewAuxiliary (com.intellij.openapi.vcs.changes.committed.VcsCommittedViewAuxiliary)2 AnAction (com.intellij.openapi.actionSystem.AnAction)1 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)1 DefaultActionGroup (com.intellij.openapi.actionSystem.DefaultActionGroup)1 ChangeList (com.intellij.openapi.vcs.changes.ChangeList)1 CommittedChangeList (com.intellij.openapi.vcs.versionBrowser.CommittedChangeList)1 StringSelection (java.awt.datatransfer.StringSelection)1 NotNull (org.jetbrains.annotations.NotNull)1 ConfigureBranchesAction (org.jetbrains.idea.svn.branchConfig.ConfigureBranchesAction)1