mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
refactoring - following CR-IC-4721
This commit is contained in:
+8
-24
@@ -18,31 +18,15 @@ package com.intellij.openapi.keymap.impl;
|
||||
public class ShortcutRestrictions {
|
||||
public static final ShortcutRestrictions NO_RESTRICTIONS = new ShortcutRestrictions(true, true, true, true);
|
||||
|
||||
private final boolean myAllowMouseShortcut;
|
||||
private final boolean myAllowMouseDoubleClick;
|
||||
private final boolean myAllowKeyboardShortcut;
|
||||
private final boolean myAllowAbbreviation;
|
||||
public final boolean allowMouseShortcut;
|
||||
public final boolean allowMouseDoubleClick;
|
||||
public final boolean allowKeyboardShortcut;
|
||||
public final boolean allowAbbreviation;
|
||||
|
||||
public ShortcutRestrictions(boolean allowMouseShortcut, boolean allowMouseDoubleClick, boolean allowKeyboardShortcut, boolean allowAbbreviation) {
|
||||
myAllowMouseShortcut = allowMouseShortcut;
|
||||
myAllowMouseDoubleClick = allowMouseDoubleClick;
|
||||
myAllowKeyboardShortcut = allowKeyboardShortcut;
|
||||
myAllowAbbreviation = allowAbbreviation;
|
||||
}
|
||||
|
||||
public boolean allowMouseShortcut() {
|
||||
return myAllowMouseShortcut;
|
||||
}
|
||||
|
||||
public boolean allowMouseDoubleClick() {
|
||||
return myAllowMouseDoubleClick;
|
||||
}
|
||||
|
||||
public boolean allowKeyboardShortcut() {
|
||||
return myAllowKeyboardShortcut;
|
||||
}
|
||||
|
||||
public boolean allowAbbreviation() {
|
||||
return myAllowAbbreviation;
|
||||
this.allowMouseShortcut = allowMouseShortcut;
|
||||
this.allowMouseDoubleClick = allowMouseDoubleClick;
|
||||
this.allowKeyboardShortcut = allowKeyboardShortcut;
|
||||
this.allowAbbreviation = allowAbbreviation;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -961,7 +961,7 @@ public class KeymapPanel extends JPanel implements SearchableConfigurable, Confi
|
||||
|
||||
final ShortcutRestrictions restrictions = ActionShortcutRestrictions.getForActionId(actionId);
|
||||
|
||||
if (restrictions.allowKeyboardShortcut()) {
|
||||
if (restrictions.allowKeyboardShortcut) {
|
||||
group.add(new DumbAwareAction("Add Keyboard Shortcut") {
|
||||
@Override
|
||||
public void actionPerformed(AnActionEvent e) {
|
||||
@@ -978,7 +978,7 @@ public class KeymapPanel extends JPanel implements SearchableConfigurable, Confi
|
||||
});
|
||||
}
|
||||
|
||||
if (restrictions.allowMouseShortcut()) {
|
||||
if (restrictions.allowMouseShortcut) {
|
||||
group.add(new DumbAwareAction("Add Mouse Shortcut") {
|
||||
@Override
|
||||
public void actionPerformed(AnActionEvent e) {
|
||||
@@ -994,7 +994,7 @@ public class KeymapPanel extends JPanel implements SearchableConfigurable, Confi
|
||||
});
|
||||
}
|
||||
|
||||
if (Registry.is("actionSystem.enableAbbreviations") && restrictions.allowAbbreviation()) {
|
||||
if (Registry.is("actionSystem.enableAbbreviations") && restrictions.allowAbbreviation) {
|
||||
group.add(new DumbAwareAction("Add Abbreviation") {
|
||||
@Override
|
||||
public void actionPerformed(AnActionEvent e) {
|
||||
|
||||
+1
-1
@@ -101,7 +101,7 @@ class MouseShortcutDialog extends DialogWrapper{
|
||||
myModifiers=-1;
|
||||
}
|
||||
|
||||
myRbDoubleClick.setEnabled(restrictions.allowMouseDoubleClick());
|
||||
myRbDoubleClick.setEnabled(restrictions.allowMouseDoubleClick);
|
||||
|
||||
updatePreviewAndConflicts();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user