mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-81098 Inconsistent Revert/Rollback naming in Commit Changes dialog
This commit is contained in:
+10
-1
@@ -27,6 +27,7 @@ import com.intellij.openapi.vcs.VcsDataKeys;
|
||||
import com.intellij.openapi.vcs.changes.Change;
|
||||
import com.intellij.openapi.vcs.changes.ui.ChangesBrowser;
|
||||
import com.intellij.openapi.vcs.changes.ui.RollbackChangesDialog;
|
||||
import com.intellij.vcsUtil.RollbackUtil;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@@ -59,6 +60,14 @@ public class RollbackDialogAction extends AnAction implements DumbAware {
|
||||
|
||||
public void update(AnActionEvent e) {
|
||||
Change[] changes = e.getData(VcsDataKeys.CHANGES);
|
||||
e.getPresentation().setEnabled(changes != null);
|
||||
Project project = e.getData(PlatformDataKeys.PROJECT);
|
||||
boolean enabled = changes != null && project != null;
|
||||
e.getPresentation().setEnabled(enabled);
|
||||
if (enabled) {
|
||||
String operationName = RollbackUtil.getRollbackOperationName(project);
|
||||
e.getPresentation().setText(operationName);
|
||||
e.getPresentation().setDescription(operationName + " selected changes");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user