return otherKeymap;
}
+ @Nullable
+ private List<String> getChangedActionIds(@NotNull KeymapImpl otherKeymap) {
+ if (!otherKeymap.isInternalKeymapListener()) {
+ return null;
+ }
+ List<String> changedActionIds = new ArrayList<>();
+ Set<String> oldKeys = otherKeymap.myActionId2ListOfShortcuts.keySet();
+ Set<String> newKeys = new HashSet<>(myActionId2ListOfShortcuts.keySet());
+
+ for (String key : oldKeys) {
+ if (newKeys.remove(key)) {
+ if (!Comparing.equal(otherKeymap.myActionId2ListOfShortcuts.get(key), myActionId2ListOfShortcuts.get(key))) {
+ changedActionIds.add(key);
+ }
+ }
+ else {
+ changedActionIds.add(key);
+ }
+ }
+ changedActionIds.addAll(newKeys);
+
+ return changedActionIds;
+ }
+
public boolean equals(Object object) {
- if (!(object instanceof Keymap)) return false;
+ if (!(object instanceof KeymapImpl)) return false;
KeymapImpl secondKeymap = (KeymapImpl)object;
- if (!Comparing.equal(myName, secondKeymap.myName)) return false;
+ if (!Comparing.equal(getName(), secondKeymap.getName())) return false;
if (myCanModify != secondKeymap.myCanModify) return false;
if (!Comparing.equal(myParent, secondKeymap.myParent)) return false;
if (!Comparing.equal(myActionId2ListOfShortcuts, secondKeymap.myActionId2ListOfShortcuts)) return false;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.components.*;
import com.intellij.openapi.keymap.Keymap;
+ import com.intellij.openapi.keymap.KeymapManager;
import com.intellij.openapi.keymap.KeymapManagerListener;
import com.intellij.openapi.keymap.ex.KeymapManagerEx;
-import com.intellij.openapi.options.Scheme;
-import com.intellij.openapi.options.SchemeProcessor;
-import com.intellij.openapi.options.SchemesManager;
-import com.intellij.openapi.options.SchemesManagerFactory;
+import com.intellij.openapi.options.*;
import com.intellij.openapi.util.*;
import com.intellij.openapi.util.text.StringUtil;
+ import com.intellij.util.ParameterizedRunnable;
import com.intellij.util.containers.ContainerUtil;
import org.jdom.Element;
import org.jetbrains.annotations.NonNls;
setActiveKeymap(keymap);
}
}
- mySchemesManager.loadSchemes();
+ mySchemeManager.loadSchemes();
+ ParameterizedRunnable<KeymapManager> runnable = WelcomeWizardUtil.getWizardCreateKeymapRunnable();
+ if (runnable != null) {
+ runnable.run(this);
+ }
+
//noinspection AssignmentToStaticFieldFromInstanceMethod
ourKeymapManagerInitialized = true;
}