mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
a shortcut for revert in line status tracker popup
This commit is contained in:
@@ -254,4 +254,5 @@ public interface IdeActions {
|
||||
String ACTION_UNDO = "$Undo";
|
||||
String ACTION_REDO = "$Redo";
|
||||
String GROUP_REFACTOR = "RefactoringMenu";
|
||||
String CHANGES_VIEW_ROLLBACK = "ChangesView.Rollback";
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import java.util.List;
|
||||
* May be customized using com.intellij.openapi.vcs.actions.VcsQuickListContentProvider extension point.
|
||||
*/
|
||||
public class VcsQuickListPopupAction extends QuickSwitchSchemeAction implements DumbAware {
|
||||
|
||||
public VcsQuickListPopupAction() {
|
||||
myActionPlace = ActionPlaces.ACTION_PLACE_VCS_QUICK_LIST_POPUP_ACTION;
|
||||
}
|
||||
@@ -98,7 +99,7 @@ public class VcsQuickListPopupAction extends QuickSwitchSchemeAction implements
|
||||
addAction("ChangesView.AddUnversioned", group);
|
||||
addAction("CheckinProject", group);
|
||||
addAction("CheckinFiles", group);
|
||||
addAction("ChangesView.Rollback", group);
|
||||
addAction(IdeActions.CHANGES_VIEW_ROLLBACK, group);
|
||||
|
||||
// history and compare
|
||||
addSeparator(group);
|
||||
|
||||
@@ -14,10 +14,7 @@ package com.intellij.openapi.vcs.ex;
|
||||
|
||||
import com.intellij.codeInsight.hint.EditorFragmentComponent;
|
||||
import com.intellij.codeInsight.hint.HintManagerImpl;
|
||||
import com.intellij.openapi.actionSystem.ActionManager;
|
||||
import com.intellij.openapi.actionSystem.ActionPlaces;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.DefaultActionGroup;
|
||||
import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.diff.DiffColors;
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
@@ -51,6 +48,7 @@ import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.util.EventObject;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author irengrig
|
||||
@@ -159,11 +157,15 @@ public class LineStatusTrackerDrawing {
|
||||
localShowNextAction.copyFrom(globalShowNextAction);
|
||||
localShowPrevAction.copyFrom(globalShowPrevAction);
|
||||
|
||||
group.add(new RollbackLineStatusRangeAction(tracker, range, editor));
|
||||
final RollbackLineStatusRangeAction rollback = new RollbackLineStatusRangeAction(tracker, range, editor);
|
||||
EmptyAction.setupAction(rollback, IdeActions.CHANGES_VIEW_ROLLBACK, editorComponent);
|
||||
group.add(rollback);
|
||||
|
||||
group.add(new ShowLineStatusRangeDiffAction(tracker, range, editor));
|
||||
group.add(new CopyLineStatusRangeAction(tracker, range));
|
||||
|
||||
final java.util.List<AnAction> actionList = (java.util.List<AnAction>)editorComponent.getClientProperty(AnAction.ourClientProperty);
|
||||
@SuppressWarnings("unchecked")
|
||||
final List<AnAction> actionList = (List<AnAction>)editorComponent.getClientProperty(AnAction.ourClientProperty);
|
||||
|
||||
actionList.remove(globalShowPrevAction);
|
||||
actionList.remove(globalShowNextAction);
|
||||
@@ -200,6 +202,7 @@ public class LineStatusTrackerDrawing {
|
||||
final LightweightHint lightweightHint = new LightweightHint(component);
|
||||
lightweightHint.addHintListener(new HintListener() {
|
||||
public void hintHidden(final EventObject event) {
|
||||
actionList.remove(rollback);
|
||||
actionList.remove(localShowPrevAction);
|
||||
actionList.remove(localShowNextAction);
|
||||
actionList.add(globalShowPrevAction);
|
||||
|
||||
Reference in New Issue
Block a user